-
- Type Parameters:
V- the entry type
- All Known Subinterfaces:
Index.Mutable<V>
public interface Index<V>An immutable String lookup data structure.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIndex.Builder<V>Builder ofIndexinstances.static interfaceIndex.Mutable<V>A mutable String lookup data structure.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Vget(java.lang.String s)Get an exact match from a String keyVget(java.lang.String s, int offset, int len)Get an exact match from a String keyVget(java.nio.ByteBuffer b)Get an exact match from a segment of a ByteBuufer as keyVget(java.nio.ByteBuffer b, int offset, int len)Get an exact match from a segment of a ByteBuufer as keyVgetBest(byte[] b, int offset, int len)Get the best match from key in a byte array.VgetBest(java.lang.String s)Get the best match from key in a String.VgetBest(java.lang.String s, int offset, int len)Get the best match from key in a String.VgetBest(java.nio.ByteBuffer b, int offset, int len)Get the best match from key in a byte buffer.booleanisEmpty()Check if the index contains any entry.java.util.Set<java.lang.String>keySet()Get aSetof the keys contained in this index.intsize()Get the number of entries in the index.
-
-
-
Method Detail
-
get
V get(java.lang.String s)
Get an exact match from a String key- Parameters:
s- The key- Returns:
- the value for the string key
-
get
V get(java.nio.ByteBuffer b)
Get an exact match from a segment of a ByteBuufer as key- Parameters:
b- The buffer- Returns:
- The value or null if not found
-
get
V get(java.lang.String s, int offset, int len)
Get an exact match from a String key- Parameters:
s- The keyoffset- The offset within the string of the keylen- the length of the key- Returns:
- the value for the string / offset / length
-
get
V get(java.nio.ByteBuffer b, int offset, int len)
Get an exact match from a segment of a ByteBuufer as key- Parameters:
b- The bufferoffset- The offset within the buffer of the keylen- the length of the key- Returns:
- The value or null if not found
-
getBest
V getBest(java.lang.String s, int offset, int len)
Get the best match from key in a String.- Parameters:
s- The stringoffset- The offset within the string of the keylen- the length of the key- Returns:
- The value or null if not found
-
getBest
V getBest(java.nio.ByteBuffer b, int offset, int len)
Get the best match from key in a byte buffer. The key is assumed to by ISO_8859_1 characters.- Parameters:
b- The bufferoffset- The offset within the buffer of the keylen- the length of the key- Returns:
- The value or null if not found
-
getBest
V getBest(java.lang.String s)
Get the best match from key in a String.- Parameters:
s- The string- Returns:
- The value or null if not found
-
getBest
V getBest(byte[] b, int offset, int len)
Get the best match from key in a byte array. The key is assumed to by ISO_8859_1 characters.- Parameters:
b- The bufferoffset- The offset within the array of the keylen- the length of the key- Returns:
- The value or null if not found
-
isEmpty
boolean isEmpty()
Check if the index contains any entry.- Returns:
- true if the index does not contain any entry.
-
size
int size()
Get the number of entries in the index.- Returns:
- the index' entries count.
-
keySet
java.util.Set<java.lang.String> keySet()
Get aSetof the keys contained in this index.- Returns:
- a
Setof the keys contained in this index.
-
-