public class ListedHashTree extends HashTree implements java.io.Serializable, java.lang.Cloneable
HashTree
collection class. In the ListedHashTree, the order in which values are added
is preserved . 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(java.util.Collection<?> keys) |
ListedHashTree(java.lang.Object key) |
ListedHashTree(java.lang.Object[] keys) |
Modifier and Type | Method and Description |
---|---|
HashTree |
add(java.lang.Object key)
Adds an key into the HashTree at the current level.
|
void |
clear()
Clears the HashTree of all contents.
|
java.lang.Object |
clone()
Create a clone of this HashTree.
|
HashTree |
createNewTree()
Creates a new tree.
|
HashTree |
createNewTree(java.util.Collection<?> values)
Creates a new tree.
|
HashTree |
createNewTree(java.lang.Object key)
Creates a new tree.
|
boolean |
equals(java.lang.Object o)
Compares all objects in the tree and verifies that the two trees contain
the same objects at the same tree levels.
|
java.lang.Object[] |
getArray()
Gets an array of all keys in the current HashTree node.
|
int |
hashCode()
Returns a hashcode for this HashTree.
|
java.util.Collection<java.lang.Object> |
list()
Gets a Collection of all keys in the current HashTree node.
|
HashTree |
remove(java.lang.Object key)
Removes the entire branch specified by the given key.
|
void |
replaceKey(java.lang.Object currentKey,
java.lang.Object newKey)
Finds the given current key, and replaces it with the given new key.
|
void |
set(java.lang.Object key,
java.util.Collection<?> values)
Sets a key and its values in the HashTree.
|
void |
set(java.lang.Object key,
HashTree t)
Sets a key into the current tree and assigns it a HashTree as its
subtree.
|
void |
set(java.lang.Object key,
java.lang.Object value)
Sets a key and it's value in the HashTree.
|
void |
set(java.lang.Object key,
java.lang.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(java.lang.Object key)
public ListedHashTree(java.util.Collection<?> keys)
public ListedHashTree(java.lang.Object[] keys)
public java.lang.Object clone()
public void set(java.lang.Object key, java.lang.Object value)
public void set(java.lang.Object key, HashTree t)
public void set(java.lang.Object key, java.lang.Object[] values)
public void set(java.lang.Object key, java.util.Collection<?> values)
public void replaceKey(java.lang.Object currentKey, java.lang.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(java.lang.Object key)
createNewTree
in class HashTree
key
- object to use as the key for the top levelHashTree
public HashTree createNewTree(java.util.Collection<?> values)
createNewTree
in class HashTree
values
- objects to be added to the new HashTree
HashTree
public HashTree add(java.lang.Object key)
public java.util.Collection<java.lang.Object> list()
public HashTree remove(java.lang.Object key)
public java.lang.Object[] getArray()
public int hashCode()
public boolean equals(java.lang.Object o)
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.