org.apache.jorphan.collections
Class SortedHashTree
java.lang.Object
org.apache.jorphan.collections.HashTree
org.apache.jorphan.collections.SortedHashTree
- All Implemented Interfaces:
- Map, Serializable
- public class SortedHashTree
- extends HashTree
- 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.7 $
- Author:
- mstover1 at apache.org
- See Also:
HashTree
,
HashTreeTraverser
,
Serialized Form
Fields inherited from class org.apache.jorphan.collections.HashTree |
data |
Methods inherited from class org.apache.jorphan.collections.HashTree |
add, add, add, add, add, add, add, add, add, add, add, add, add, add, addTreePath, clear, cloneTree, containsKey, containsValue, entrySet, equals, get, getArray, getArray, getArray, getArray, getTree, getTree, getTree, getTreePath, hashCode, isEmpty, keySet, list, list, list, list, put, putAll, remove, replace, search, set, set, set, set, set, set, set, set, set, size, toString, traverse, values |
comparator
protected Comparator comparator
SortedHashTree
public SortedHashTree()
SortedHashTree
public SortedHashTree(Comparator comper)
SortedHashTree
public SortedHashTree(Object key)
SortedHashTree
public SortedHashTree(Object key,
Comparator comper)
SortedHashTree
public SortedHashTree(Collection keys)
SortedHashTree
public SortedHashTree(Collection keys,
Comparator comper)
SortedHashTree
public SortedHashTree(Object[] keys)
SortedHashTree
public SortedHashTree(Object[] keys,
Comparator comper)
createNewTree
protected HashTree 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
- Returns:
- HashTree
createNewTree
protected HashTree createNewTree(Object 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
- Returns:
- HashTree
createNewTree
protected HashTree createNewTree(Collection 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
- Returns:
- HashTree
clone
public Object 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
- See Also:
Object.clone()
setComparator
public void setComparator(Comparator comparator)
- Parameters:
comparator
- The comparator to set.
Copyright © 1998-2005 Apache Software Foundation. All Rights Reserved.