Package soot

Class PatchingChain<E extends Unit>

    • Field Detail

      • innerChain

        protected final Chain<E extends Unit> innerChain
    • Constructor Detail

      • PatchingChain

        public PatchingChain​(Chain<E> aChain)
        Constructs a PatchingChain from the given Chain.
    • Method Detail

      • getNonPatchingChain

        public Chain<E> getNonPatchingChain()
        Returns the inner chain used by the PatchingChain. In general, this should not be used. However, direct access to the inner chain may be necessary if you wish to perform certain operations (such as control-flow manipulations) without interference from the patching algorithms.
      • swapWith

        public void swapWith​(E out,
                             E in)
        Replaces out in the Chain by in.
        Specified by:
        swapWith in interface Chain<E extends Unit>
      • insertAfter

        public void insertAfter​(E toInsert,
                                E point)
        Inserts toInsert in the Chain after point.
        Specified by:
        insertAfter in interface Chain<E extends Unit>
      • insertAfter

        public void insertAfter​(List<E> toInsert,
                                E point)
        Inserts toInsert in the Chain after point.
        Specified by:
        insertAfter in interface Chain<E extends Unit>
      • insertAfter

        public void insertAfter​(Chain<E> toInsert,
                                E point)
        Description copied from interface: Chain
        Inserts toInsert in the Chain after point.
        Specified by:
        insertAfter in interface Chain<E extends Unit>
      • insertAfter

        public void insertAfter​(Collection<? extends E> toInsert,
                                E point)
        Description copied from interface: Chain
        Inserts toInsert in the Chain after point.
        Specified by:
        insertAfter in interface Chain<E extends Unit>
      • insertBefore

        public void insertBefore​(List<E> toInsert,
                                 E point)
        Inserts toInsert in the Chain before point.
        Specified by:
        insertBefore in interface Chain<E extends Unit>
      • insertBefore

        public void insertBefore​(Chain<E> toInsert,
                                 E point)
        Inserts toInsert in the Chain before point.
        Specified by:
        insertBefore in interface Chain<E extends Unit>
      • insertBefore

        public void insertBefore​(E toInsert,
                                 E point)
        Inserts toInsert in the Chain before point.
        Specified by:
        insertBefore in interface Chain<E extends Unit>
      • insertBefore

        public void insertBefore​(Collection<? extends E> toInsert,
                                 E point)
        Description copied from interface: Chain
        Inserts toInsert in the Chain before point.
        Specified by:
        insertBefore in interface Chain<E extends Unit>
      • insertBeforeNoRedirect

        public void insertBeforeNoRedirect​(E toInsert,
                                           E point)
        Inserts toInsert in the Chain before point WITHOUT redirecting jumps.
      • insertBeforeNoRedirect

        public void insertBeforeNoRedirect​(List<E> toInsert,
                                           E point)
        Inserts toInsert in the Chain before point WITHOUT redirecting jumps.
      • follows

        public boolean follows​(E a,
                               E b)
        Returns true if object a follows object b in the Chain.
        Specified by:
        follows in interface Chain<E extends Unit>
      • patchBeforeRemoval

        protected static <E extends Unit> void patchBeforeRemoval​(Chain<E> chain,
                                                                  E removing)
      • addFirst

        public void addFirst​(E u)
        Adds the given object at the beginning of the Chain.
        Specified by:
        addFirst in interface Chain<E extends Unit>
      • addLast

        public void addLast​(E u)
        Adds the given object at the end of the Chain.
        Specified by:
        addLast in interface Chain<E extends Unit>
      • removeFirst

        public void removeFirst()
        Removes the first object from this Chain.
        Specified by:
        removeFirst in interface Chain<E extends Unit>
      • removeLast

        public void removeLast()
        Removes the last object from this Chain.
        Specified by:
        removeLast in interface Chain<E extends Unit>
      • getFirst

        public E getFirst()
        Returns the first object in this Chain.
        Specified by:
        getFirst in interface Chain<E extends Unit>
      • getLast

        public E getLast()
        Returns the last object in this Chain.
        Specified by:
        getLast in interface Chain<E extends Unit>
      • getSuccOf

        public E getSuccOf​(E point)
        Returns the object immediately following point.
        Specified by:
        getSuccOf in interface Chain<E extends Unit>
      • getPredOf

        public E getPredOf​(E point)
        Returns the object immediately preceding point.
        Specified by:
        getPredOf in interface Chain<E extends Unit>
      • getModificationCount

        public long getModificationCount()
        Returns the number of times this chain has been modified.
        Specified by:
        getModificationCount in interface Chain<E extends Unit>
      • getElementsUnsorted

        public Collection<E> getElementsUnsorted()
        Description copied from interface: Chain
        Gets all elements in the chain. There is no guarantee on sorting. On the other hand, the collection returned by this method is thread-safe. You can iterate over it even in the case of concurrent modifications to the underlying chain.
        Specified by:
        getElementsUnsorted in interface Chain<E extends Unit>
        Returns:
        All elements in the chain in an unsorted collection
      • snapshotIterator

        public Iterator<E> 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!
        Specified by:
        snapshotIterator in interface Chain<E extends Unit>
      • iterator

        public Iterator<E> iterator​(E u)
        Returns an iterator over this Chain, starting at the given object.
        Specified by:
        iterator in interface Chain<E extends Unit>
      • iterator

        public Iterator<E> iterator​(E head,
                                    E tail)
        Returns an iterator over this Chain, starting at head and reaching tail (inclusive).
        Specified by:
        iterator in interface Chain<E extends Unit>