Package nom.tam.util
Class HashedList.HashedListIterator
- java.lang.Object
-
- nom.tam.util.HashedList.HashedListIterator
-
- All Implemented Interfaces:
java.util.Iterator<VALUE>,Cursor<java.lang.String,VALUE>
- Enclosing class:
- HashedList<VALUE extends CursorValue<java.lang.String>>
private class HashedList.HashedListIterator extends java.lang.Object implements Cursor<java.lang.String,VALUE>
-
-
Field Summary
Fields Modifier and Type Field Description private intcurrentThis index points to the value that would be returned in the next 'next' call.
-
Constructor Summary
Constructors Constructor Description HashedListIterator(int start)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String key, VALUE ref)Add a keyed entry at the current location.voidadd(VALUE reference)Add an unkeyed element to the collection.VALUEend()move to the last element and return that.booleanhasNext()booleanhasPrev()VALUEnext()VALUEnext(int count)Returns the count next element in the iteration.VALUEprev()voidremove()voidsetKey(java.lang.String key)Point the iterator to a particular keyed entry.
-
-
-
Method Detail
-
add
public void add(java.lang.String key, VALUE ref)Description copied from interface:CursorAdd 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.- Specified by:
addin interfaceCursor<java.lang.String,VALUE extends CursorValue<java.lang.String>>- Parameters:
key- the key of the value to addref- the value to add
-
add
public void add(VALUE reference)
Description copied from interface:CursorAdd 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.- Specified by:
addin interfaceCursor<java.lang.String,VALUE extends CursorValue<java.lang.String>>- Parameters:
reference- the value to add
-
end
public VALUE end()
Description copied from interface:Cursormove to the last element and return that.- Specified by:
endin interfaceCursor<java.lang.String,VALUE extends CursorValue<java.lang.String>>- Returns:
- the last element.
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<VALUE extends CursorValue<java.lang.String>>
-
hasPrev
public boolean hasPrev()
- Specified by:
hasPrevin interfaceCursor<java.lang.String,VALUE extends CursorValue<java.lang.String>>- Returns:
- Is there a previous element in the collection?
-
next
public VALUE next()
- Specified by:
nextin interfacejava.util.Iterator<VALUE extends CursorValue<java.lang.String>>
-
next
public VALUE next(int count)
Description copied from interface:CursorReturns the count next element in the iteration.- Specified by:
nextin interfaceCursor<java.lang.String,VALUE extends CursorValue<java.lang.String>>- Parameters:
count- the offset- Returns:
- the n'th next element in the iteration
-
prev
public VALUE prev()
- Specified by:
previn interfaceCursor<java.lang.String,VALUE extends CursorValue<java.lang.String>>- Returns:
- the previous element.
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<VALUE extends CursorValue<java.lang.String>>
-
setKey
public void setKey(java.lang.String key)
Description copied from interface:CursorPoint 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.- Specified by:
setKeyin interfaceCursor<java.lang.String,VALUE extends CursorValue<java.lang.String>>- Parameters:
key- the key to search for
-
-