Level 165 Level 167
Level 166

Iterator


14 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Ignore?
boolean hasNext()
Returns true if there are more elements. Otherwise, returns false.
Object next()
Returns the next element. Throws NoSuchElementException if there is not a next element.
void remove()
Removes the current element. Throws IllegalStateException if an attempt is made to call remove( ) that is not preceded by a call to next( ).
void add(Object obj)
Inserts obj into the list in front of the element that will be returned by the next call to next( ).
boolean hasNext()
Returns true if there is a next element. Otherwise, returns false.
boolean hasPrevious()
Returns true if there is a previous element. Otherwise, returns false.
Object next()
Returns the next element. A NoSuchElementException is thrown if there is not a next element.
int nextIndex()
Returns the index of the next element. If there is not a next element, returns the size of the list.
Object previous()
Returns the previous element. A NoSuchElementException is thrown if there is not a previous element.
int previousIndex()
Returns the index of the previous element. If there is not a previous element, returns -1.
void remove()
Removes the current element from the list. An IllegalStateException is thrown if remove( ) is called before next( ) or previous( ) is invoked.
void set(Object obj)
Assigns obj to the current element. This is the element last returned by a call to either next( ) or previous( ).
int compare(Object obj1, Object obj2)
the compare Method
boolean equals(Object obj)
the equals Method