Class AbstractPatriciaTrie.TrieEntry<K,V>
- java.lang.Object
-
- org.apache.commons.collections4.trie.AbstractPatriciaTrie.TrieEntry<K,V>
-
- Type Parameters:
K- the key type.V- the value type.
- All Implemented Interfaces:
java.io.Serializable,java.util.Map.Entry<K,V>
- Enclosing class:
- AbstractPatriciaTrie<K,V>
protected static class AbstractPatriciaTrie.TrieEntry<K,V> extends java.lang.Object
ATrieis a set ofAbstractPatriciaTrie.TrieEntrynodes.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intbitIndexThe index this entry is comparing.protected KkeyThe entry's key.protected AbstractPatriciaTrie.TrieEntry<K,V>leftThe left child of this entry.protected AbstractPatriciaTrie.TrieEntry<K,V>parentThe parent of this entry.protected AbstractPatriciaTrie.TrieEntry<K,V>predecessorThe entry who uplinks to this entry.protected AbstractPatriciaTrie.TrieEntry<K,V>rightThe right child of this entry.protected VvalueThe entry's value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)KgetKey()VgetValue()inthashCode()booleanisEmpty()Tests whether the entry is storing a key.booleanisExternalNode()Tests whether the left or right child is a loopback.booleanisInternalNode()Tests that neither the left nor right child is a loopback.VsetKeyValue(K key, V value)Replaces the current key and value with the provided key & value.VsetValue(V value)java.lang.StringtoString()
-
-
-
Field Detail
-
bitIndex
protected int bitIndex
The index this entry is comparing.
-
parent
protected AbstractPatriciaTrie.TrieEntry<K,V> parent
The parent of this entry.
-
left
protected AbstractPatriciaTrie.TrieEntry<K,V> left
The left child of this entry.
-
right
protected AbstractPatriciaTrie.TrieEntry<K,V> right
The right child of this entry.
-
predecessor
protected AbstractPatriciaTrie.TrieEntry<K,V> predecessor
The entry who uplinks to this entry.
-
key
protected K key
The entry's key.
-
value
protected V value
The entry's value.
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Tests whether the entry is storing a key. Only the root can potentially be empty, all other nodes must have a key.- Returns:
- Whether the entry is storing a key
-
isExternalNode
public boolean isExternalNode()
Tests whether the left or right child is a loopback.- Returns:
- Whether the left or right child is a loopback.
-
isInternalNode
public boolean isInternalNode()
Tests that neither the left nor right child is a loopback.- Returns:
- That neither the left nor right child is a loopback.
-
toString
public java.lang.String toString()
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Map.Entry<K,V>- Overrides:
equalsin classjava.lang.Object
-
getKey
public K getKey()
- Specified by:
getKeyin interfacejava.util.Map.Entry<K,V>
-
getValue
public V getValue()
- Specified by:
getValuein interfacejava.util.Map.Entry<K,V>
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Map.Entry<K,V>- Overrides:
hashCodein classjava.lang.Object
-
setKeyValue
public V setKeyValue(K key, V value)Replaces the current key and value with the provided key & value.- Parameters:
key- The new key.value- The new value.- Returns:
- The previous value.
-
setValue
public V setValue(V value)
- Specified by:
setValuein interfacejava.util.Map.Entry<K,V>
-
-