Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.jorphan.collections
Class SortedHashTree  view SortedHashTree download SortedHashTree.java

java.lang.Object
  extended byorg.apache.jorphan.collections.HashTree
      extended byorg.apache.jorphan.collections.SortedHashTree
All Implemented Interfaces:
java.util.Map, java.io.Serializable

public class SortedHashTree
extends HashTree
implements java.io.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.8 $

Nested Class Summary
 
Nested classes inherited from class org.apache.jorphan.collections.HashTree
HashTree.Test
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
protected  java.util.Comparator comparator
           
 
Fields inherited from class org.apache.jorphan.collections.HashTree
data
 
Constructor Summary
SortedHashTree()
           
SortedHashTree(java.util.Collection keys)
           
SortedHashTree(java.util.Collection keys, java.util.Comparator comper)
           
SortedHashTree(java.util.Comparator comper)
           
SortedHashTree(java.lang.Object key)
           
SortedHashTree(java.lang.Object[] keys)
           
SortedHashTree(java.lang.Object[] keys, java.util.Comparator comper)
           
SortedHashTree(java.lang.Object key, java.util.Comparator comper)
           
 
Method Summary
 java.lang.Object clone()
          Create a clone of this HashTree.
protected  HashTree createNewTree()
          Creates a new tree.
protected  HashTree createNewTree(java.util.Collection values)
          Creates a new tree.
protected  HashTree createNewTree(java.lang.Object key)
          Creates a new tree.
 void setComparator(java.util.Comparator comparator)
           
 
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, readObject, remove, replace, search, set, set, set, set, set, set, set, set, set, size, toString, traverse, values, writeObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

comparator

protected java.util.Comparator comparator
Constructor Detail

SortedHashTree

public SortedHashTree()

SortedHashTree

public SortedHashTree(java.util.Comparator comper)

SortedHashTree

public SortedHashTree(java.lang.Object key)

SortedHashTree

public SortedHashTree(java.lang.Object key,
                      java.util.Comparator comper)

SortedHashTree

public SortedHashTree(java.util.Collection keys)

SortedHashTree

public SortedHashTree(java.util.Collection keys,
                      java.util.Comparator comper)

SortedHashTree

public SortedHashTree(java.lang.Object[] keys)

SortedHashTree

public SortedHashTree(java.lang.Object[] keys,
                      java.util.Comparator comper)
Method Detail

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

createNewTree

protected HashTree createNewTree(java.lang.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

createNewTree

protected HashTree createNewTree(java.util.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

clone

public java.lang.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

setComparator

public void setComparator(java.util.Comparator comparator)