Class SortedHashTree
java.lang.Object
org.apache.jorphan.collections.HashTree
org.apache.jorphan.collections.SortedHashTree
- All Implemented Interfaces:
Serializable, Cloneable, Map<Object,HashTree>
SortedHashTree is a different implementation of the
HashTree
collection class. In the SortedHashTree, the ordering of values in the tree
is made explicit via the compare() function of objects added to the tree.
This works in exactly the same fashion as it does for a SortedSet.- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSortedHashTree(Object key) SortedHashTree(Object[] keys) SortedHashTree(Object[] keys, Comparator<? super Object> comper) SortedHashTree(Object key, Comparator<? super Object> comper) SortedHashTree(Collection<?> keys) SortedHashTree(Collection<?> keys, Comparator<? super Object> comper) SortedHashTree(Comparator<? super Object> comper) -
Method Summary
Modifier and TypeMethodDescriptionprotected HashTreeCreates a new tree.protected HashTreecreateNewTree(Object key) Creates a new tree.protected HashTreecreateNewTree(Collection<?> values) Creates a new tree.Methods inherited from class HashTree
add, add, add, add, add, add, add, add, add, add, add, add, add, add, addTreePath, clear, clone, cloneTree, containsKey, containsValue, entrySet, equals, get, getArray, getArray, getArray, getArray, getTree, getTree, getTree, getTreePath, hashCode, isEmpty, keySet, list, list, list, list, put, putAll, remove, replaceKey, search, set, set, set, set, set, set, set, set, set, size, toString, traverse, valuesMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
SortedHashTree
public SortedHashTree() -
SortedHashTree
-
SortedHashTree
-
SortedHashTree
-
SortedHashTree
-
SortedHashTree
-
SortedHashTree
-
SortedHashTree
-
-
Method Details
-
createNewTree
Creates a new tree. This method exists to allow inheriting classes to generate the appropriate types of nodes. For instance, when a node is added, it's value is a HashTree. Rather than directly calling the HashTree() constructor, the createNewTree() method is called. Inheriting classes should override these methods and create the appropriate subclass of HashTree.- Overrides:
createNewTreein classHashTree- Returns:
- HashTree
-
createNewTree
Creates a new tree. This method exists to allow inheriting classes to generate the appropriate types of nodes. For instance, when a node is added, it's value is a HashTree. Rather than directly calling the HashTree() constructor, the createNewTree() method is called. Inheriting classes should override these methods and create the appropriate subclass of HashTree.- Overrides:
createNewTreein classHashTree- Parameters:
key- object to use as the key for the top level- Returns:
- newly created
HashTree
-
createNewTree
Creates a new tree. This method exists to allow inheriting classes to generate the appropriate types of nodes. For instance, when a node is added, it's value is a HashTree. Rather than directly calling the HashTree() constructor, the createNewTree() method is called. Inheriting classes should override these methods and create the appropriate subclass of HashTree.- Overrides:
createNewTreein classHashTree- Parameters:
values- objects to be added to the newHashTree- Returns:
- newly created
HashTree
-