|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
soot.util.HashChain
Reference implementation of the Chain interface, using a HashMap as the underlying structure.
Constructor Summary | |
HashChain()
Constructs an empty HashChain. |
Method Summary | |
boolean |
add(Object item)
Adds the given object to this HashChain. |
void |
addFirst(Object item)
Adds the given object at the beginning of the Chain. |
void |
addLast(Object item)
Adds the given object at the end of the Chain. |
void |
clear()
Erases the contents of the current HashChain. |
boolean |
contains(Object o)
|
boolean |
containsAll(Collection c)
|
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 item)
Returns an iterator over this Chain, starting at the given object. |
Iterator |
iterator(Object head,
Object tail)
Returns an iterator ranging from head to
tail , inclusive. |
static HashChain |
listToHashChain(List list)
|
boolean |
remove(Object item)
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. |
Iterator |
snapshotIterator(Object item)
|
void |
swapWith(Object out,
Object in)
Replaces out in the Chain by in . |
static List |
toList(Chain c)
Returns an unbacked list containing the contents of the given Chain. |
String |
toString()
Returns a textual representation of the contents of this Chain. |
Methods inherited from class java.util.AbstractCollection |
addAll, isEmpty, removeAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
addAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray |
Constructor Detail |
public HashChain()
Method Detail |
public void clear()
clear
in interface Collection
public void swapWith(Object out, Object in)
Chain
out
in the Chain by in
.
swapWith
in interface Chain
public boolean add(Object item)
add
in interface Collection
public static List toList(Chain c)
public boolean follows(Object someObject, Object someReferenceObject)
Chain
someObject
follows object someReferenceObject
in the Chain.
follows
in interface Chain
public boolean contains(Object o)
contains
in interface Collection
public boolean containsAll(Collection c)
containsAll
in interface Collection
public void insertAfter(Object toInsert, Object point)
Chain
toInsert
in the Chain after point
.
insertAfter
in interface Chain
public void insertAfter(List toInsert, Object point)
Chain
toInsert
in the Chain after point
.
insertAfter
in interface Chain
public void insertAfter(Chain toInsert, Object point)
Chain
toInsert
in the Chain after point
.
(It would probably be better to make Chain implement List)
insertAfter
in interface Chain
public void insertBefore(Object toInsert, Object point)
Chain
toInsert
in the Chain before point
.
insertBefore
in interface Chain
public void insertBefore(List toInsert, Object point)
Chain
toInsert
in the Chain before point
.
insertBefore
in interface Chain
public void insertBefore(Chain toInsert, Object point)
Chain
toInsert
in the Chain before point
.
(It would probably be better to make Chain implement List)
insertBefore
in interface Chain
public static HashChain listToHashChain(List list)
public boolean remove(Object item)
Chain
remove
in interface Chain
public void addFirst(Object item)
Chain
addFirst
in interface Chain
public void addLast(Object item)
Chain
addLast
in interface Chain
public void removeFirst()
Chain
removeFirst
in interface Chain
public void removeLast()
Chain
removeLast
in interface Chain
public Object getFirst()
Chain
getFirst
in interface Chain
public Object getLast()
Chain
getLast
in interface Chain
public Object getSuccOf(Object point) throws NoSuchElementException
Chain
point
.
getSuccOf
in interface Chain
NoSuchElementException
public Object getPredOf(Object point) throws NoSuchElementException
Chain
point
.
getPredOf
in interface Chain
NoSuchElementException
public Iterator snapshotIterator()
Chain
snapshotIterator
in interface Chain
public Iterator snapshotIterator(Object item)
public Iterator iterator()
Chain
iterator
in interface Chain
public Iterator iterator(Object item)
Chain
iterator
in interface Chain
public Iterator iterator(Object head, Object tail)
Returns an iterator ranging from head
to
tail
, inclusive.
If tail
is the element immediately preceding
head
in this HashChain
, the returned
iterator will iterate 0 times (a special case to allow the
specification of an empty range of elements). Otherwise if
tail
is not one of the elements following
head
, the returned iterator will iterate past the
end of the HashChain
, provoking a
NoSuchElementException
.
iterator
in interface Chain
NoSuchElementException
- if head
is not
an element of the chain.public int size()
Chain
size
in interface Chain
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |