Class ExtensibleList<T>
java.lang.Object
soot.jimple.infoflow.util.extensiblelist.ExtensibleList<T>
- Type Parameters:
T- the type to save in this list
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIn case this list is locked, a new one is created and returned.addFirstSlow(T toAdd) Adds an element to the beginning.booleanReturns the first element.getLast()Returns the last elementinthashCode()booleanisEmpty()Returns true when this list is emptyRemoves the last element and returns it Alternatively, it may return an extensible list, in case the original one could not be changed!soot.jimple.infoflow.util.extensiblelist.ExtensibleList.ExtensibleListIterator<T>Returns an iterator, which works reverse through the listintsize()Returns the size of the listtoString()
-
Constructor Details
-
ExtensibleList
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() -
size
public int size()Returns the size of the list- Returns:
- the size
-
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
-
isEmpty
public boolean isEmpty()Returns true when this list is empty- Returns:
- true when this list is empty
-
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
Returns the last element- Returns:
- the last element or null
-
equals
-
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
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
-
getActualList
-