|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Augmented data type guaranteeing O(1) insertion and removal from a set of ordered, unique elements.
Method Summary | |
void |
addFirst(Object u)
Adds the given object at the beginning of the Chain. |
void |
addLast(Object u)
Adds the given object at the end of the Chain. |
boolean |
follows(Object someObject,
Object someReferenceObject)
Returns true if object someObject follows object someReferenceObject in the Chain. |
Object |
getFirst()
Returns the first object in this Chain. |
Object |
getLast()
Returns the last object in this Chain. |
Object |
getPredOf(Object point)
Returns the object immediately preceding point . |
Object |
getSuccOf(Object point)
Returns the object immediately following point . |
void |
insertAfter(Chain toInsert,
Object point)
Inserts toInsert in the Chain after point . |
void |
insertAfter(List toInsert,
Object point)
Inserts toInsert in the Chain after point . |
void |
insertAfter(Object toInsert,
Object point)
Inserts toInsert in the Chain after point . |
void |
insertBefore(Chain toInsert,
Object point)
Inserts toInsert in the Chain before point . |
void |
insertBefore(List toInsert,
Object point)
Inserts toInsert in the Chain before point . |
void |
insertBefore(Object toInsert,
Object point)
Inserts toInsert in the Chain before point . |
Iterator |
iterator()
Returns an iterator over this Chain. |
Iterator |
iterator(Object u)
Returns an iterator over this Chain, starting at the given object. |
Iterator |
iterator(Object head,
Object tail)
Returns an iterator over this Chain, starting at head and reaching tail (inclusive). |
boolean |
remove(Object u)
Removes the given object from this Chain. |
void |
removeFirst()
Removes the first object contained in this Chain. |
void |
removeLast()
Removes the last object contained in this Chain. |
int |
size()
Returns the size of this Chain. |
Iterator |
snapshotIterator()
Returns an iterator over a copy of this chain. |
void |
swapWith(Object out,
Object in)
Replaces out in the Chain by in . |
Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray |
Method Detail |
public void insertBefore(List toInsert, Object point)
toInsert
in the Chain before point
.
public void insertAfter(List toInsert, Object point)
toInsert
in the Chain after point
.
public void insertAfter(Object toInsert, Object point)
toInsert
in the Chain after point
.
public void insertBefore(Object toInsert, Object point)
toInsert
in the Chain before point
.
public void insertBefore(Chain toInsert, Object point)
toInsert
in the Chain before point
.
(It would probably be better to make Chain implement List)
public void insertAfter(Chain toInsert, Object point)
toInsert
in the Chain after point
.
(It would probably be better to make Chain implement List)
public void swapWith(Object out, Object in)
out
in the Chain by in
.
public boolean remove(Object u)
remove
in interface Collection
public void addFirst(Object u)
public void addLast(Object u)
public void removeFirst()
public void removeLast()
public boolean follows(Object someObject, Object someReferenceObject)
someObject
follows object someReferenceObject
in the Chain.
public Object getFirst()
public Object getLast()
public Object getSuccOf(Object point)
point
.
public Object getPredOf(Object point)
point
.
public Iterator snapshotIterator()
public Iterator iterator()
iterator
in interface Collection
public Iterator iterator(Object u)
public Iterator iterator(Object head, Object tail)
public int size()
size
in interface Collection
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |