public class Tree extends Base implements Cloneable, Serializable
As of Coherence 3.3 this class is a wrapper around TreeMap
.
Note: Where practical, use java.util.TreeMap
; including
external syncronization as necessary.
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
protected TreeMap |
m_tree
The delgate tree.
|
Constructor and Description |
---|
Tree()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Comparable key)
Add the passed key to the tree.
|
boolean |
addAll(Tree that)
Adds all of the nodes in the specified Tree to this Tree if they are not
already present.
|
void |
clear()
Remove all nodes from the tree.
|
Object |
clone()
Make a shallow copy of the tree and its nodes.
|
boolean |
contains(Comparable key)
Determine if the passed key is in the tree.
|
Enumeration |
elements()
Create an enumerator for the tree's values.
|
boolean |
equals(Object obj)
Test for tree equality.
|
Object |
get(Comparable key)
Find the specified key and return its value.
|
int |
getSize()
Determine the size of the tree.
|
protected Enumeration |
getUnsynchronizedKeyEnumerator()
Get an enumerator of the nodes in the tree.
|
protected Enumeration |
getUnsynchronizedKeyEnumerator(Comparable key)
Get an enumerator of the nodes in the tree.
|
boolean |
isEmpty()
Test for empty tree.
|
Enumeration |
keys()
Create an in-order enumerator for the tree's keys.
|
void |
print()
In-order printing of the contents of the tree.
|
void |
put(Comparable key,
Object value)
Add the passed key to the tree and associate the passed value with the
key.
|
void |
putAll(Tree that)
Puts all of the nodes in the specified Tree to this Tree (including the ones
that are already present).
|
Object |
remove(Comparable key)
Remove the specified key from the tree, returning its associated value.
|
boolean |
removeAll(Tree that)
Removes from this Tree all of its nodes that are contained in the
specified Tree.
|
boolean |
retainAll(Tree that)
Retains only the nodes in this Tree that are contained in the specified
Tree.
|
String |
toString()
Provide a string representation of the tree.
|
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
protected TreeMap m_tree
public void add(Comparable key)
key
- the key to add to the treepublic void put(Comparable key, Object value)
key
- the key to add to the treevalue
- the object to associate with the keypublic Object get(Comparable key)
key
- the key to look for in the treepublic boolean contains(Comparable key)
key
- the key to look for in the treepublic Object remove(Comparable key)
key
- the key to look for in the treepublic void clear()
public int getSize()
public boolean isEmpty()
public Enumeration keys()
public Enumeration elements()
public boolean addAll(Tree that)
Collection.addAll(Collection)
public void putAll(Tree that)
public boolean retainAll(Tree that)
Collection.retainAll(Collection)
public boolean removeAll(Tree that)
Collection.removeAll(Collection)
public String toString()
public Object clone()
public void print()
protected Enumeration getUnsynchronizedKeyEnumerator()
protected Enumeration getUnsynchronizedKeyEnumerator(Comparable key)