|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet
common.IndexedTreeSetDiff
public class IndexedTreeSetDiff
Implementation of the IndexedSortedSet interface that is represented as a set of differences from an underlying IndexedSortedSet.
An IndexedSetDiff will behave correctly if objects are added to the underlying set after the IndexedSetDiff is created, as long as these objects have not also been added to the IndexedSetDiff (then they would be double-counted). Removing objects from the underlying set may cause an IndexedSetDiff to behave incorrectly, because it may change the indices of elements of the underlying set.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface common.IndexedSet |
|---|
IndexedSet.EmptyIndexedSet |
| Field Summary |
|---|
| Fields inherited from interface common.IndexedSet |
|---|
EMPTY_INDEXED_SET |
| Constructor Summary | |
|---|---|
IndexedTreeSetDiff(IndexedSortedSet underlying)
Creates a new IndexedTreeSetDiff with the given underlying IndexedSortedSet. |
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)
|
void |
changeUnderlying()
Changes the underlying IndexedSet so it is equal to this one, and clears the changes in this IndexedSetDiff. |
void |
clearChanges()
Clears the changes in this IndexedSetDiff so it is once again equal to the underlying IndexedSet. |
java.util.Comparator |
comparator()
|
boolean |
contains(java.lang.Object o)
|
java.lang.Object |
first()
|
java.lang.Object |
get(int index)
Returns the object with the specified index in this IndexedSet. |
java.util.Set |
getAdditions()
Returns the set of objects that are in this set and not the underlying set. |
java.util.Set |
getRemovals()
Returns the set of objects that are in the underlying set but not in this set. |
java.util.SortedSet |
headSet(java.lang.Object toElement)
|
int |
indexOf(java.lang.Object o)
Returns the index of the given object in this IndexedSet, or -1 if this IndexedSet does not contain the given object. |
java.util.Iterator |
iterator()
|
java.lang.Object |
last()
|
static void |
main(java.lang.String[] args)
Test program. |
boolean |
remove(java.lang.Object o)
|
int |
size()
|
java.util.SortedSet |
subSet(java.lang.Object fromElement,
java.lang.Object toElement)
|
java.util.SortedSet |
tailSet(java.lang.Object fromElement)
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public IndexedTreeSetDiff(IndexedSortedSet underlying)
| Method Detail |
|---|
public int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class java.util.AbstractCollectionpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setiterator in class java.util.AbstractCollectionpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Setcontains in class java.util.AbstractCollectionpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Setadd in class java.util.AbstractCollectionpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setremove in class java.util.AbstractCollectionpublic java.lang.Object get(int index)
IndexedSet
get in interface IndexedSetpublic int indexOf(java.lang.Object o)
IndexedSet
indexOf in interface IndexedSetpublic java.util.Comparator comparator()
comparator in interface java.util.SortedSetpublic java.lang.Object first()
first in interface java.util.SortedSetpublic java.lang.Object last()
last in interface java.util.SortedSetpublic java.util.SortedSet headSet(java.lang.Object toElement)
headSet in interface java.util.SortedSetpublic java.util.SortedSet tailSet(java.lang.Object fromElement)
tailSet in interface java.util.SortedSet
public java.util.SortedSet subSet(java.lang.Object fromElement,
java.lang.Object toElement)
subSet in interface java.util.SortedSetpublic java.util.Set getAdditions()
getAdditions in interface SetDiffpublic java.util.Set getRemovals()
getRemovals in interface SetDiffpublic void changeUnderlying()
changeUnderlying in interface SetDiffpublic void clearChanges()
clearChanges in interface SetDiffpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||