Package nom.tam.util
Interface Cursor<KEY,VALUE>
- Type Parameters:
KEY
- the generic type of the keyword elementVALUE
- the generic type of the associated value
- All Superinterfaces:
Iterator<VALUE>
An
Iterator
-based interface for key / value pairs allowing insertions and reverse movement also.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.void
Add an unkeyed element to the collection.end()
Moves to the last element and returns it.boolean
hasPrev()
Checks if there is an element prior to the current one.next
(int count) Returns the count next element in the iteration.prev()
Returns the previous element in the ordered collection.void
Point the iterator to a particular keyed entry.Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
add
Deprecated.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()Moves to the last element and returns it.- Returns:
- the last element.
-
hasPrev
boolean hasPrev()Checks if there is an element prior to the current one.- Returns:
- Whether there is 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 in the ordered collection.- 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