org.garret.perst
Class PatriciaTrieKey
java.lang.Object
org.garret.perst.PatriciaTrieKey
- public class PatriciaTrieKey
- extends java.lang.Object
Convert different type of keys to 64-bit long value used in PATRICIA trie
(Practical Algorithm To Retrieve Information Coded In Alphanumeric)
|
Field Summary |
int |
length
Length of bit vector (can not be larger than 64) |
long |
mask
Bit mask representing bit vector. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
length
public final int length
- Length of bit vector (can not be larger than 64)
mask
public final long mask
- Bit mask representing bit vector.
The last digit of the key is the right most bit of the mask
PatriciaTrieKey
public PatriciaTrieKey(long mask,
int length)
from7bitString
public static PatriciaTrieKey from7bitString(java.lang.String str)
from8bitString
public static PatriciaTrieKey from8bitString(java.lang.String str)
fromByteArray
public static PatriciaTrieKey fromByteArray(byte[] arr)
fromDecimalDigits
public static PatriciaTrieKey fromDecimalDigits(java.lang.String digits)
fromIpAddress
public static PatriciaTrieKey fromIpAddress(java.net.InetAddress addr)
fromIpAddress
public static PatriciaTrieKey fromIpAddress(java.lang.String addr)
throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException