soot.util
Interface Chain

All Superinterfaces:
java.util.Collection, java.io.Serializable
All Known Implementing Classes:
HashChain, PatchingChain

public interface Chain
extends java.util.Collection, java.io.Serializable

Augmented data type guaranteeing O(1) insertion and removal from a set of ordered, unique elements.


Method Summary
 void addFirst(java.lang.Object u)
          Adds the given object at the beginning of the Chain.
 void addLast(java.lang.Object u)
          Adds the given object at the end of the Chain.
 boolean follows(java.lang.Object someObject, java.lang.Object someReferenceObject)
          Returns true if object someObject follows object someReferenceObject in the Chain.
 java.lang.Object getFirst()
          Returns the first object in this Chain.
 java.lang.Object getLast()
          Returns the last object in this Chain.
 java.lang.Object getPredOf(java.lang.Object point)
          Returns the object immediately preceding point.
 java.lang.Object getSuccOf(java.lang.Object point)
          Returns the object immediately following point.
 void insertAfter(java.util.List toInsert, java.lang.Object point)
          Inserts toInsert in the Chain after point.
 void insertAfter(java.lang.Object toInsert, java.lang.Object point)
          Inserts toInsert in the Chain after point.
 void insertBefore(java.util.List toInsert, java.lang.Object point)
          Inserts toInsert in the Chain before point.
 void insertBefore(java.lang.Object toInsert, java.lang.Object point)
          Inserts toInsert in the Chain before point.
 java.util.Iterator iterator()
          Returns an iterator over this Chain.
 java.util.Iterator iterator(java.lang.Object u)
          Returns an iterator over this Chain, starting at the given object.
 java.util.Iterator iterator(java.lang.Object head, java.lang.Object tail)
          Returns an iterator over this Chain, starting at head and reaching tail (inclusive).
 boolean remove(java.lang.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.
 java.util.Iterator snapshotIterator()
          Returns an iterator over a copy of this chain.
 void swapWith(java.lang.Object out, java.lang.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

insertBefore

public void insertBefore(java.util.List toInsert,
                         java.lang.Object point)
Inserts toInsert in the Chain before point.


insertAfter

public void insertAfter(java.util.List toInsert,
                        java.lang.Object point)
Inserts toInsert in the Chain after point.


insertAfter

public void insertAfter(java.lang.Object toInsert,
                        java.lang.Object point)
Inserts toInsert in the Chain after point.


insertBefore

public void insertBefore(java.lang.Object toInsert,
                         java.lang.Object point)
Inserts toInsert in the Chain before point.


swapWith

public void swapWith(java.lang.Object out,
                     java.lang.Object in)
Replaces out in the Chain by in.


remove

public boolean remove(java.lang.Object u)
Removes the given object from this Chain.

Specified by:
remove in interface java.util.Collection

addFirst

public void addFirst(java.lang.Object u)
Adds the given object at the beginning of the Chain.


addLast

public void addLast(java.lang.Object u)
Adds the given object at the end of the Chain.


removeFirst

public void removeFirst()
Removes the first object contained in this Chain.


removeLast

public void removeLast()
Removes the last object contained in this Chain.


follows

public boolean follows(java.lang.Object someObject,
                       java.lang.Object someReferenceObject)
Returns true if object someObject follows object someReferenceObject in the Chain.


getFirst

public java.lang.Object getFirst()
Returns the first object in this Chain.


getLast

public java.lang.Object getLast()
Returns the last object in this Chain.


getSuccOf

public java.lang.Object getSuccOf(java.lang.Object point)
Returns the object immediately following point.


getPredOf

public java.lang.Object getPredOf(java.lang.Object point)
Returns the object immediately preceding point.


snapshotIterator

public java.util.Iterator snapshotIterator()
Returns an iterator over a copy of this chain. This avoids ConcurrentModificationExceptions from being thrown if the underlying Chain is modified during iteration. Do not use this to remove elements which have not yet been iterated over!


iterator

public java.util.Iterator iterator()
Returns an iterator over this Chain.

Specified by:
iterator in interface java.util.Collection

iterator

public java.util.Iterator iterator(java.lang.Object u)
Returns an iterator over this Chain, starting at the given object.


iterator

public java.util.Iterator iterator(java.lang.Object head,
                                   java.lang.Object tail)
Returns an iterator over this Chain, starting at head and reaching tail (inclusive).


size

public int size()
Returns the size of this Chain.

Specified by:
size in interface java.util.Collection