public class ListedHashTree extends HashTree implements Serializable, Cloneable
HashTree
collection class. In the ListedHashTree, the order in which values are added
is preserved (not to be confused with SortedHashTree
, which sorts
the order of the values using the compare() function). Any listing of nodes
or iteration through the list of nodes of a ListedHashTree will be given in
the order in which the nodes were added to the tree.HashTree
,
Serialized FormConstructor and Description |
---|
ListedHashTree() |
ListedHashTree(Collection<?> keys) |
ListedHashTree(Object key) |
ListedHashTree(Object[] keys) |
Modifier and Type | Method and Description |
---|---|
HashTree |
add(Object key)
Adds an key into the HashTree at the current level.
|
void |
clear()
Clears the HashTree of all contents.
|
Object |
clone()
Create a clone of this HashTree.
|
HashTree |
createNewTree()
Creates a new tree.
|
HashTree |
createNewTree(Collection<?> values)
Creates a new tree.
|
HashTree |
createNewTree(Object key)
Creates a new tree.
|
boolean |
equals(Object o)
Compares all objects in the tree and verifies that the two trees contain
the same objects at the same tree levels.
|
Object[] |
getArray()
Gets an array of all keys in the current HashTree node.
|
int |
hashCode()
Returns a hashcode for this HashTree.
|
Collection<Object> |
list()
Gets a Collection of all keys in the current HashTree node.
|
HashTree |
remove(Object key)
Removes the entire branch specified by the given key.
|
void |
replaceKey(Object currentKey,
Object newKey)
Finds the given current key, and replaces it with the given new key.
|
void |
set(Object key,
Collection<?> values)
Sets a key and its values in the HashTree.
|
void |
set(Object key,
HashTree t)
Sets a key into the current tree and assigns it a HashTree as its
subtree.
|
void |
set(Object key,
Object value)
Sets a key and it's value in the HashTree.
|
void |
set(Object key,
Object[] values)
Sets a key and its values in the HashTree.
|
add, add, add, add, add, add, add, add, add, add, add, add, add, addTreePath, cloneTree, containsKey, containsValue, entrySet, get, getArray, getArray, getArray, getTree, getTree, getTree, getTreePath, isEmpty, keySet, list, list, list, put, putAll, search, set, set, set, set, set, size, toString, traverse, values
public ListedHashTree()
public ListedHashTree(Object key)
public ListedHashTree(Collection<?> keys)
public ListedHashTree(Object[] keys)
public Object clone()
public void set(Object key, Object value)
public void set(Object key, HashTree t)
public void set(Object key, Object[] values)
public void set(Object key, Collection<?> values)
public void replaceKey(Object currentKey, Object newKey)
replaceKey
in class HashTree
currentKey
- name of the key to be replacednewKey
- name of the new keypublic HashTree createNewTree()
createNewTree
in class HashTree
public HashTree createNewTree(Object key)
createNewTree
in class HashTree
key
- object to use as the key for the top levelHashTree
public HashTree createNewTree(Collection<?> values)
createNewTree
in class HashTree
values
- objects to be added to the new HashTree
HashTree
public HashTree add(Object key)
public Collection<Object> list()
public Object[] getArray()
public int hashCode()
public boolean equals(Object o)
Copyright © 1998-2016 Apache Software Foundation. All Rights Reserved.