org.garret.perst
Class PatriciaTrieKey

java.lang.Object
  extended by 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.
 
Constructor Summary
PatriciaTrieKey(long mask, int length)
           
 
Method Summary
static PatriciaTrieKey from7bitString(java.lang.String str)
           
static PatriciaTrieKey from8bitString(java.lang.String str)
           
static PatriciaTrieKey fromByteArray(byte[] arr)
           
static PatriciaTrieKey fromDecimalDigits(java.lang.String digits)
           
static PatriciaTrieKey fromIpAddress(java.net.InetAddress addr)
           
static PatriciaTrieKey fromIpAddress(java.lang.String addr)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

Constructor Detail

PatriciaTrieKey

public PatriciaTrieKey(long mask,
                       int length)
Method Detail

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