Class StringKeyAnalyzer
java.lang.Object
org.apache.commons.collections4.trie.KeyAnalyzer<String>
org.apache.commons.collections4.trie.analyzer.StringKeyAnalyzer
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringKeyAnalyzerA singleton instance ofStringKeyAnalyzer.static final intThe number of bits perCharacter.Fields inherited from class org.apache.commons.collections4.trie.KeyAnalyzerEQUAL_BIT_KEY, NULL_BIT_KEY, OUT_OF_BOUNDS_BIT_KEY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintbitIndex(String key, int offsetInBits, int lengthInBits, String other, int otherOffsetInBits, int otherLengthInBits) Returns the n-th different bit between key and other.intReturns the number of bits per element in the key.booleanReturns whether or not a bit is set.booleanDetermines whether or not the given prefix (from offset to length) is a prefix of the given key.intlengthInBits(String key) Returns the length of the Key in bits.Methods inherited from class org.apache.commons.collections4.trie.KeyAnalyzercompareMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparatorequals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
- 
Field Details- 
INSTANCEA singleton instance ofStringKeyAnalyzer.
- 
LENGTH
 
- 
- 
Constructor Details- 
StringKeyAnalyzer
 
- 
- 
Method Details- 
bitIndexpublic int bitIndex(String key, int offsetInBits, int lengthInBits, String other, int otherOffsetInBits, int otherLengthInBits) Description copied from class:KeyAnalyzerReturns the n-th different bit between key and other. This starts the comparison in key at 'offsetInBits' and goes for 'lengthInBits' bits, and compares to the other key starting at 'otherOffsetInBits' and going for 'otherLengthInBits' bits.- Specified by:
- bitIndexin class- KeyAnalyzer<String>
- Parameters:
- key- the key to use
- offsetInBits- the bit offset in the key
- lengthInBits- the maximum key length in bits to use
- other- the other key to use
- otherOffsetInBits- the bit offset in the other key
- otherLengthInBits- the maximum key length in bits for the other key
- Returns:
- the bit index where the key and other first differ
 
- 
bitsPerElementDescription copied from class:KeyAnalyzerReturns the number of bits per element in the key. This is only useful for variable-length keys, such as Strings.- Specified by:
- bitsPerElementin class- KeyAnalyzer<String>
- Returns:
- the number of bits per element
 
- 
isBitSetDescription copied from class:KeyAnalyzerReturns whether or not a bit is set.- Specified by:
- isBitSetin class- KeyAnalyzer<String>
- Parameters:
- key- the key to check, may not be null
- bitIndex- the bit index to check
- lengthInBits- the maximum key length in bits to check
- Returns:
- trueif the bit is set in the given key and- bitIndex<- lengthInBits,- falseotherwise.
 
- 
isPrefixDescription copied from class:KeyAnalyzerDetermines whether or not the given prefix (from offset to length) is a prefix of the given key.- Specified by:
- isPrefixin class- KeyAnalyzer<String>
- Parameters:
- prefix- the prefix to check
- offsetInBits- the bit offset in the key
- lengthInBits- the maximum key length in bits to use
- key- the key to check
- Returns:
- trueif this is a valid prefix for the given key
 
- 
lengthInBitsDescription copied from class:KeyAnalyzerReturns the length of the Key in bits.- Specified by:
- lengthInBitsin class- KeyAnalyzer<String>
- Parameters:
- key- the key
- Returns:
- the bit length of the key
 
 
- 
INSTANCE.