public class PatchingChain<E extends Unit> extends java.util.AbstractCollection<E> implements Chain<E>
Modifier and Type | Class and Description |
---|---|
protected class |
PatchingChain.PatchingIterator |
Modifier and Type | Field and Description |
---|---|
protected Chain<E> |
innerChain |
Constructor and Description |
---|
PatchingChain(Chain<E> aChain)
Constructs a PatchingChain from the given Chain.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o)
Adds the given object to this Chain.
|
void |
addFirst(E u)
Adds the given object at the beginning of the Chain.
|
void |
addLast(E u)
Adds the given object at the end of the Chain.
|
boolean |
contains(java.lang.Object u)
Returns true if this patching chain contains the specified element.
|
boolean |
follows(E a,
E b)
Returns true if object
a follows object b in the Chain. |
java.util.Collection<E> |
getElementsUnsorted()
Gets all elements in the chain.
|
E |
getFirst()
Returns the first object in this Chain.
|
E |
getLast()
Returns the last object in this Chain.
|
long |
getModificationCount()
Returns the number of times this chain has been modified.
|
Chain<E> |
getNonPatchingChain()
Returns the inner chain used by the PatchingChain.
|
E |
getPredOf(E point)
Returns the object immediately preceding
point . |
E |
getSuccOf(E point)
Returns the object immediately following
point . |
void |
insertAfter(Chain<E> toInsert,
E point)
Inserts
toInsert in the Chain after point . |
void |
insertAfter(E toInsert,
E point)
Inserts
toInsert in the Chain after point . |
void |
insertAfter(java.util.List<E> toInsert,
E point)
Inserts
toInsert in the Chain after point . |
void |
insertBefore(Chain<E> toInsert,
E point)
Inserts
toInsert in the Chain before point . |
void |
insertBefore(E toInsert,
E point)
Inserts
toInsert in the Chain before point . |
void |
insertBefore(java.util.List<E> toInsert,
E point)
Inserts
toInsert in the Chain before point . |
void |
insertBeforeNoRedirect(E toInsert,
E point)
Inserts
toInsert in the Chain before point WITHOUT redirecting jumps. |
void |
insertOnEdge(Chain<E> toInsert,
E point_src,
E point_tgt)
Inserts instrumentation in a manner such that the resulting control flow
graph (CFG) of the program will contain
toInsert on an edge
that is defined by point_source and point_target . |
void |
insertOnEdge(E toInsert,
E point_src,
E point_tgt)
Inserts instrumentation in a manner such that the resulting control flow
graph (CFG) of the program will contain
toInsert on an edge
that is defined by point_source and point_target . |
void |
insertOnEdge(java.util.List<E> toInsert,
E point_src,
E point_tgt)
Inserts instrumentation in a manner such that the resulting control flow
graph (CFG) of the program will contain
toInsert on an edge
that is defined by point_source and point_target . |
java.util.Iterator<E> |
iterator()
Returns an iterator over this Chain.
|
java.util.Iterator<E> |
iterator(E u)
Returns an iterator over this Chain, starting at the given object.
|
java.util.Iterator<E> |
iterator(E head,
E tail)
Returns an iterator over this Chain, starting at head and reaching tail (inclusive).
|
boolean |
remove(java.lang.Object obj)
Removes the given object from this Chain.
|
void |
removeFirst()
Removes the first object from this Chain.
|
void |
removeLast()
Removes the last object from this Chain.
|
int |
size()
Returns the size of this Chain.
|
java.util.Iterator<E> |
snapshotIterator()
Returns an iterator over a copy of this chain.
|
void |
swapWith(E out,
E in)
Replaces
out in the Chain by in . |
addAll, clear, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public Chain<E> getNonPatchingChain()
public boolean add(E o)
public void insertAfter(E toInsert, E point)
toInsert
in the Chain after point
.insertAfter
in interface Chain<E extends Unit>
public void insertAfter(java.util.List<E> toInsert, E point)
toInsert
in the Chain after point
.insertAfter
in interface Chain<E extends Unit>
public void insertAfter(Chain<E> toInsert, E point)
Chain
toInsert
in the Chain after point
.
(It would probably be better to make Chain implement List)insertAfter
in interface Chain<E extends Unit>
public void insertBefore(java.util.List<E> toInsert, E point)
toInsert
in the Chain before point
.insertBefore
in interface Chain<E extends Unit>
public void insertBefore(Chain<E> toInsert, E point)
toInsert
in the Chain before point
.insertBefore
in interface Chain<E extends Unit>
public void insertBefore(E toInsert, E point)
toInsert
in the Chain before point
.insertBefore
in interface Chain<E extends Unit>
public void insertBeforeNoRedirect(E toInsert, E point)
toInsert
in the Chain before point
WITHOUT redirecting jumps.public void insertOnEdge(E toInsert, E point_src, E point_tgt)
toInsert
on an edge
that is defined by point_source
and point_target
.insertOnEdge
in interface Chain<E extends Unit>
toInsert
- the instrumentation to be added in the Chainpoint_src
- the source point of an edge in CFGpoint_tgt
- the target point of an edgepublic void insertOnEdge(java.util.List<E> toInsert, E point_src, E point_tgt)
toInsert
on an edge
that is defined by point_source
and point_target
.insertOnEdge
in interface Chain<E extends Unit>
toInsert
- instrumentation to be added in the Chainpoint_src
- the source point of an edge in CFGpoint_tgt
- the target point of an edgepublic void insertOnEdge(Chain<E> toInsert, E point_src, E point_tgt)
toInsert
on an edge
that is defined by point_source
and point_target
.insertOnEdge
in interface Chain<E extends Unit>
toInsert
- instrumentation to be added in the Chainpoint_src
- the source point of an edge in CFGpoint_tgt
- the target point of an edgepublic boolean remove(java.lang.Object obj)
public boolean contains(java.lang.Object u)
public void addFirst(E u)
public void addLast(E u)
public void removeFirst()
removeFirst
in interface Chain<E extends Unit>
public void removeLast()
removeLast
in interface Chain<E extends Unit>
public E getFirst()
public E getLast()
public java.util.Iterator<E> snapshotIterator()
snapshotIterator
in interface Chain<E extends Unit>
public java.util.Iterator<E> iterator()
public java.util.Iterator<E> iterator(E u)
public java.util.Iterator<E> iterator(E head, E tail)
public int size()
public long getModificationCount()
Chain
getModificationCount
in interface Chain<E extends Unit>
public java.util.Collection<E> getElementsUnsorted()
Chain
getElementsUnsorted
in interface Chain<E extends Unit>