Package ghidra.program.model.pcode
Class ListLinked<T>
java.lang.Object
ghidra.program.model.pcode.ListLinked<T>
A better linked list implementation than provided by java.util.
TODO: Looks like the main benefit is a non-failing iterator. In JDK 1.5
this may not be needed. 1.5 has better Iterators in the collections classes.
-
Method Summary
Modifier and TypeMethodDescriptionAdd object to end of the list, any existing iterators remain validvoid
clear()
Get rid of all entries on the linked list.first()
insertAfter
(Iterator<T> itr, T o) Insert new object AFTER object pointed to by iterator, other Iterators remain validinsertBefore
(Iterator<T> itr, T o) Insert new object BEFORE object pointed to by iterator, other Iterators remain validiterator()
last()
void
Remove object from list indicated by Iterator, all iterators that point to objects other than this one remain valid
-
Method Details
-
add
Add object to end of the list, any existing iterators remain valid- Parameters:
o
- -- Object to be added- Returns:
- Iterator to new object
-
insertAfter
Insert new object AFTER object pointed to by iterator, other Iterators remain valid- Parameters:
itr
- Iterator to existing objecto
- New object to add- Returns:
- Iterator to new object
-
insertBefore
Insert new object BEFORE object pointed to by iterator, other Iterators remain valid- Parameters:
itr
- Iterator to existing objecto
- New object to add- Returns:
- Iterator to new object
-
remove
Remove object from list indicated by Iterator, all iterators that point to objects other than this one remain valid- Parameters:
itr
- Iterator to object to be removed
-
iterator
- Returns:
- an iterator over this linked list
-
clear
public void clear()Get rid of all entries on the linked list. -
first
- Returns:
- the first element in the list (or null)
-
last
- Returns:
- the last element in the list (or null)
-