java.lang.ObjectContentList.FilterListIterator
class ContentList.FilterListIterator
Field Summary | |
---|---|
(package private) int |
cursor
Index in backing list of next object |
(package private) int |
expected
Expected modCount in our backing list |
(package private) Filter |
filter
The Filter that applies |
(package private) int |
initialCursor
Initial start index in backing list |
(package private) int |
last
Index in backing list of last object returned |
(package private) int |
lastOperation
The last operation performed |
Constructor Summary | |
---|---|
ContentList.FilterListIterator(Filter filter,
int start)
Default constructor |
Method Summary | |
---|---|
void |
add(java.lang.Object obj)
Inserts the specified element into the list. |
private void |
checkConcurrentModification()
Check if are backing list is being modified by someone else. |
boolean |
hasNext()
Returns true if this list iterator has a next element. |
boolean |
hasPrevious()
Returns true if this list iterator has more
elements when traversing the list in the reverse direction. |
private int |
initializeCursor(int start)
Returns index in the backing list by moving forward start objects that match our filter. |
private int |
moveBackward(int start)
Returns index in the backing list of the next object matching our filter, starting at the given index and moving backwards. |
private int |
moveForward(int start)
Returns index in the backing list of the next object matching our filter, starting at the given index and moving forwards. |
java.lang.Object |
next()
Returns the next element in the list. |
int |
nextIndex()
Returns the index of the element that would be returned by a subsequent call to next . |
java.lang.Object |
previous()
Returns the previous element in the list. |
int |
previousIndex()
Returns the index of the element that would be returned by a subsequent call to previous . |
void |
remove()
Removes from the list the last element that was returned by next or previous . |
void |
set(java.lang.Object obj)
Replaces the last element returned by next or
previous with the specified element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
Filter filter
int lastOperation
int initialCursor
int cursor
int last
int expected
Constructor Detail |
---|
ContentList.FilterListIterator(Filter filter, int start)
Method Detail |
---|
public boolean hasNext()
true
if this list iterator has a next element.
hasNext
in interface java.util.Iterator
hasNext
in interface java.util.ListIterator
public java.lang.Object next()
next
in interface java.util.Iterator
next
in interface java.util.ListIterator
public boolean hasPrevious()
true
if this list iterator has more
elements when traversing the list in the reverse direction.
hasPrevious
in interface java.util.ListIterator
public java.lang.Object previous()
previous
in interface java.util.ListIterator
public int nextIndex()
next
.
nextIndex
in interface java.util.ListIterator
public int previousIndex()
previous
. (Returns -1 if the
list iterator is at the beginning of the list.)
previousIndex
in interface java.util.ListIterator
public void add(java.lang.Object obj)
add
in interface java.util.ListIterator
public void remove()
next
or previous
.
the last call to next
or previous
.
remove
in interface java.util.Iterator
remove
in interface java.util.ListIterator
public void set(java.lang.Object obj)
next
or
previous
with the specified element.
set
in interface java.util.ListIterator
private int initializeCursor(int start)
private int moveForward(int start)
private int moveBackward(int start)
private void checkConcurrentModification()