Package nom.tam.util
Interface Cursor<KEY,VALUE>
- All Superinterfaces:
Iterator<VALUE>
This interface extends the Iterator interface to allow insertion of data and
move to previous entries in a collection.
-
Method Summary
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
add
Deprecated.use key parameter can be omitted, so useadd(Object)
insteadAdd a keyed entry at the current location. The new entry is inserted before the entry that would be returned in the next invocation of 'next'. The new element is placed such that it will be called by a prev() call, but not a next() call.The return value for that call is unaffected. Note: this method is not in the Iterator interface.- Parameters:
key
- the key of the value to addreference
- the value to add
-
add
Add an unkeyed element to the collection. The new element is placed such that it will be called by a prev() call, but not a next() call.- Parameters:
reference
- the value to add
-
end
VALUE end()move to the last element and return that.- Returns:
- the last element.
-
hasPrev
boolean hasPrev()- Returns:
- Is there a previous element in the collection?
-
next
Returns the count next element in the iteration.- Parameters:
count
- the offset- Returns:
- the n'th next element in the iteration
- Throws:
NoSuchElementException
- if the iteration has no more elements
-
prev
VALUE prev()- Returns:
- the previous element.
-
setKey
Point the iterator to a particular keyed entry. Point to the end of the list if the key is not found.This method is not in the Iterator interface.- Parameters:
key
- the key to search for
-
add(Object)
instead