protected static class KeyedSet.Empty<T extends Keyed<K>,K extends Comparable<K>> extends KeyedSet<K,T>
KeyedSet.Empty<T extends Keyed<K>,K extends Comparable<K>>, KeyedSet.ReverseTreeIterable, KeyedSet.ReverseTreeIterator, KeyedSet.ReverseValueIterable, KeyedSet.ReverseValueIterator, KeyedSet.TreeIterable, KeyedSet.TreeState, KeyedSet.ValueIterable, KeyedSet.ValueIterator| Modifier | Constructor and Description |
|---|---|
protected |
KeyedSet.Empty() |
| Modifier and Type | Method and Description |
|---|---|
protected KeyedSet<K,T> |
addElement(T element,
boolean[] added)
addEntry returns this tree with added element
|
void |
collect(Collection<T> collection)
Add all elements to collection.
|
boolean |
containsAll(Iterable<T> elements) |
boolean |
containsAny(Iterable<T> elements) |
boolean |
containsKey(K key)
Test if tree contains the specified key.
|
protected boolean |
containsKey(T value) |
KeyedSet<K,T> |
deleteFirst()
Delete the first element of the tree.
|
protected KeyedSet<K,T> |
deleteKey(K key,
boolean[] deleted) |
KeyedSet<K,T> |
deleteLast()
Delete the last element of the tree.
|
Iterable<T> |
elements()
Return an iterable that can be used in foreach to obtain elements
in ascending order.
|
boolean |
equals(Object o)
Compare sets.
|
KeyedSet<K,T> |
filter(Filter filter)
Filter the set, removing all elements for which the
test method returns false. |
T |
get(K key)
Get the element with matching key.
|
T |
getFirst()
Get the first element in the tree.
|
T |
getLast()
Get the last element in the tree.
|
int |
hashCode()
Get the hashCode for the set.
|
protected void |
init() |
boolean |
isEmpty() |
Iterator<T> |
iterator()
Return an iterator over the elements of the set in ascending order.
|
void |
prettyPrint() |
KeyedSet<K,T> |
removeAll(Iterable<T> iterable)
Remove all elements in iterable from tree.
|
protected KeyedSet<K,T> |
removeElement(T value,
boolean[] removed) |
KeyedSet<K,T> |
retainAll(Iterable<T> iterable)
Get all elements in both set and iterable.
|
Iterable<T> |
reverseElements()
Return an iterable that can be used in foreach to obtain elements
in descending order.
|
Iterator<T> |
reverseIterator()
Return an iterator over the elements of the set in descending order.
|
int |
size()
Get the tree size.
|
String |
toString() |
boolean |
visitFwd(ConditionalVisitor visitor)
Visit elements in order.
|
void |
visitFwd(Visitor visitor)
Visit all elements in order.
|
boolean |
visitRev(ConditionalVisitor visitor)
Visit all elements in reverse order.
|
void |
visitRev(Visitor visitor)
Visit all elements in reverse order.
|
add, add, addAll, balanceTree, clear, contains, delete, delete, getBalance, keys, newTree, prettyPrint, remove, remove, removeHigh, reverseKeys, setLeft, setRightprotected void init()
public boolean equals(Object o)
KeyedSetpublic int hashCode()
KeyedSetpublic int size()
KeyedSetisEmpty() rather than getSize() == 0.public boolean containsKey(K key)
KeyedSetcontainsKey in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>public T getFirst()
KeyedSetpublic T getLast()
KeyedSetpublic KeyedSet<K,T> deleteFirst()
KeyedSetdeleteFirst in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>public KeyedSet<K,T> deleteLast()
KeyedSetdeleteLast in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>protected boolean containsKey(T value)
containsKey in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>public boolean isEmpty()
protected KeyedSet<K,T> addElement(T element, boolean[] added)
KeyedSetaddElement in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>protected KeyedSet<K,T> removeElement(T value, boolean[] removed)
removeElement in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>public Iterator<T> iterator()
KeyedSetpublic Iterator<T> reverseIterator()
KeyedSetreverseIterator in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>public Iterable<T> elements()
KeyedSetelements in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>KeyedSet.iterator()public Iterable<T> reverseElements()
KeyedSetreverseElements in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>KeyedSet.reverseIterator()public KeyedSet<K,T> removeAll(Iterable<T> iterable)
KeyedSetpublic KeyedSet<K,T> retainAll(Iterable<T> iterable)
KeyedSetpublic void visitFwd(Visitor visitor)
KeyedSetpublic boolean visitFwd(ConditionalVisitor visitor)
KeyedSetpublic void visitRev(Visitor visitor)
KeyedSetpublic boolean visitRev(ConditionalVisitor visitor)
KeyedSetpublic KeyedSet<K,T> filter(Filter filter)
KeyedSettest method returns false.public void collect(Collection<T> collection)
KeyedSetpublic boolean containsAll(Iterable<T> elements)
containsAll in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>public boolean containsAny(Iterable<T> elements)
containsAny in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>public String toString()
public void prettyPrint()
prettyPrint in class KeyedSet<K extends Comparable<K>,T extends Keyed<K>>Copyright © 2015. All rights reserved.