org.coinjema.collections
Class SortedHashTree<T>
java.lang.Object
org.coinjema.collections.HashTree<T>
org.coinjema.collections.SortedHashTree<T>
- All Implemented Interfaces:
- Serializable, Map<T,HashTree<T>>
public class SortedHashTree<T>
- extends HashTree<T>
- implements Serializable
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.
- Version:
- $Revision: 1.1 $
- Author:
- mstover1 at apache.org
- See Also:
HashTree
,
HashTreeTraverser
,
Serialized Form
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Fields inherited from class org.coinjema.collections.HashTree |
data |
Methods inherited from class org.coinjema.collections.HashTree |
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addTreePath, clear, cloneTree, containsKey, containsValue, entrySet, equals, get, getObject, getObject, getObject, getObject, getTree, getTree, getTree, getTreePath, hashCode, isEmpty, keySet, list, list, list, list, put, putAll, remove, remove, replace, search, set, set, set, set, set, set, set, set, set, set, set, set, size, toString, traverse, values |
comparator
protected Comparator<T> comparator
SortedHashTree
public SortedHashTree()
SortedHashTree
public SortedHashTree(Comparator<T> comper)
SortedHashTree
public SortedHashTree(T key)
SortedHashTree
public SortedHashTree(T key,
Comparator<T> comper)
SortedHashTree
public SortedHashTree(Collection<? extends T> keys)
SortedHashTree
public SortedHashTree(Collection<? extends T> keys,
Comparator<T> comper)
SortedHashTree
public SortedHashTree(T[] keys)
SortedHashTree
public SortedHashTree(T[] keys,
Comparator<T> comper)
createNewTree
protected HashTree<T> createNewTree()
- Description copied from class:
HashTree
- 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:
createNewTree
in class HashTree<T>
- Returns:
- HashTree
createNewTree
protected HashTree<T> createNewTree(T key)
- Description copied from class:
HashTree
- 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:
createNewTree
in class HashTree<T>
- Returns:
- HashTree
createNewTree
protected HashTree<T> createNewTree(Collection<? extends T> values)
- Description copied from class:
HashTree
- 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:
createNewTree
in class HashTree<T>
- Returns:
- HashTree
clone
public HashTree<T> clone()
- Description copied from class:
HashTree
- Create a clone of this HashTree. This is not a deep clone (ie, the
contents of the tree are not cloned).
- Overrides:
clone
in class HashTree<T>
- See Also:
Object.clone()
setComparator
public void setComparator(Comparator<T> comparator)
- Parameters:
comparator
- The comparator to set.
Public Domain Software.