|
jInfer | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.mff.ksi.jinfer.iss.objects.DeletableList<T>
public class DeletableList<T>
Class representing a "list" that can be traversed even as items are removed
from it. The iteration should be done using the hasNext()
and next()
methods. Note that after one pass using these
methods the list cannot be traversed anymore.
Constructor Summary | |
---|---|
DeletableList(List<T> data)
Full constructor. |
Method Summary | |
---|---|
List<T> |
getLive()
Returns a list of items that are still "alive" in this object, i.e. |
boolean |
hasNext()
Checks whether there are more items to iterate. |
T |
next()
Returns the next item of the list. |
void |
remove(T t)
Removes all occurences of the specified item from the list. |
void |
removeAll(Collection<T> c)
Removes from this object all occurences of all items in the specified collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DeletableList(List<T> data)
data
- List of items this object will represent.Method Detail |
---|
public boolean hasNext()
true
if there are more items to iterate,
false
otherwise.public T next()
null
if there are
no left.public void remove(T t)
Object.equals(java.lang.Object)
to check for equality.
t
- The object to remove.public void removeAll(Collection<T> c)
Object.equals(java.lang.Object)
to check for
equality.
c
- Collection containing items to be removed.public List<T> getLive()
|
jInfer | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |