it.unimi.dsi.fastutil.objects
Class AbstractObjectIterator<K>
java.lang.Object
it.unimi.dsi.fastutil.objects.AbstractObjectIterator<K>
- All Implemented Interfaces:
- ObjectIterator<K>, Iterator<K>
- Direct Known Subclasses:
- AbstractByte2ObjectSortedMap.ValuesIterator, AbstractByte2ReferenceSortedMap.ValuesIterator, AbstractChar2ObjectSortedMap.ValuesIterator, AbstractChar2ReferenceSortedMap.ValuesIterator, AbstractDouble2ObjectSortedMap.ValuesIterator, AbstractDouble2ReferenceSortedMap.ValuesIterator, AbstractFloat2ObjectSortedMap.ValuesIterator, AbstractFloat2ReferenceSortedMap.ValuesIterator, AbstractInt2ObjectSortedMap.ValuesIterator, AbstractInt2ReferenceSortedMap.ValuesIterator, AbstractLong2ObjectSortedMap.ValuesIterator, AbstractLong2ReferenceSortedMap.ValuesIterator, AbstractObject2ObjectSortedMap.ValuesIterator, AbstractObject2ReferenceSortedMap.ValuesIterator, AbstractObjectBidirectionalIterator, AbstractReference2ObjectSortedMap.ValuesIterator, AbstractReference2ReferenceSortedMap.ValuesIterator, AbstractShort2ObjectSortedMap.ValuesIterator, AbstractShort2ReferenceSortedMap.ValuesIterator, ObjectIterators.UnmodifiableIterator
public abstract class AbstractObjectIterator<K>
- extends Object
- implements ObjectIterator<K>
An abstract class facilitating the creation of type-specific iterators.
To create a type-specific iterator you need both a method returning the
next element as primitive type and a method returning the next element as an
object. However, if you inherit from this class you need just one (anyone).
This class implements also a trivial version of skip(int)
that uses
type-specific methods; moreover, remove()
will throw an UnsupportedOperationException
.
- See Also:
Iterator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractObjectIterator
protected AbstractObjectIterator()
remove
public void remove()
- This method just throws an
UnsupportedOperationException
.
- Specified by:
remove
in interface Iterator<K>
skip
public int skip(int n)
- This method just iterates the type-specific version of
Iterator.next()
for at most
n
times, stopping if Iterator.hasNext()
becomes false.
- Specified by:
skip
in interface ObjectIterator<K>
- Parameters:
n
- the number of elements to skip.
- Returns:
- the number of elements actually skipped.
- See Also:
Iterator.next()
Copyright © 2011. All Rights Reserved.