Class ExtensibleList<T>

java.lang.Object
soot.jimple.infoflow.util.extensiblelist.ExtensibleList<T>
Type Parameters:
T - the type to save in this list

public class ExtensibleList<T> extends Object
This list is intended to be used to save lists, which share the same elements at the start of the list. The list is meant to be iterated in reverse order, and operations requiring accessing the head will be slower.
Author:
Marc Miltenberger
  • Constructor Details

    • ExtensibleList

      public ExtensibleList(ExtensibleList<T> original)
      Creates a new extensible list. The given parameter is the prepended to this list.
      Parameters:
      original - the prepended list
    • ExtensibleList

      public ExtensibleList()
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • size

      public int size()
      Returns the size of the list
      Returns:
      the size
    • add

      public ExtensibleList<T> add(T add)
      In case this list is locked, a new one is created and returned. So, always use the returned list!
      Parameters:
      add - the object to add
      Returns:
      the new list
    • addAll

      public ExtensibleList<T> addAll(T... add)
    • isEmpty

      public boolean isEmpty()
      Returns true when this list is empty
      Returns:
      true when this list is empty
    • removeLast

      public Object removeLast()
      Removes the last element and returns it Alternatively, it may return an extensible list, in case the original one could not be changed!
      Returns:
      the last element (or null) or an extensible list in case it cannot be changed in place.
    • reverseIterator

      public soot.jimple.infoflow.util.extensiblelist.ExtensibleList.ExtensibleListIterator<T> reverseIterator()
      Returns an iterator, which works reverse through the list
      Returns:
      the iterator
    • getLast

      public T getLast()
      Returns the last element
      Returns:
      the last element or null
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getFirstSlow

      public T getFirstSlow()
      Returns the first element. It is relatively slow compared to getting the last element. This method should not be used in normal path reconstruction.
      Returns:
      the first element or null
    • addFirstSlow

      public ExtensibleList<T> addFirstSlow(T toAdd)
      Adds an element to the beginning. Since this data structure was not meant to prepend an element, it is relatively slow, so be careful. Does not change this list, but returns a new list! This method should not be used in normal path reconstruction.
      Parameters:
      toAdd - the element to add
      Returns:
      the new list
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getActualList

      public List<T> getActualList()