Package com.tangosol.util
Class CopyOnWriteLongArray.UnmodifiableIterator<V>
- java.lang.Object
-
- com.tangosol.util.CopyOnWriteLongArray.UnmodifiableIterator<V>
-
- All Implemented Interfaces:
LongArray.Iterator<V>
,Iterator<V>
- Enclosing class:
- CopyOnWriteLongArray<V>
public static class CopyOnWriteLongArray.UnmodifiableIterator<V> extends Object implements LongArray.Iterator<V>
Unmodifiable view of a LongArray.Iterator.
-
-
Field Summary
Fields Modifier and Type Field Description protected LongArray.Iterator<V>
m_iteratorInternal
The internal Iterator
-
Constructor Summary
Constructors Constructor Description UnmodifiableIterator(LongArray.Iterator<V> iterator)
Construct a wrapper for the specified Iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getIndex()
Returns the index of the current value, which is the value returned by the most recent call to the next method.LongArray.Iterator<V>
getInternalIterator()
Return the internal Iterator.V
getValue()
Returns the current value, which is the same value returned by the most recent call to the next method, or the most recent value passed to setValue if setValue were called after the next method.boolean
hasNext()
Returns true if the iteration has more elements.V
next()
Returns the next element in the iteration.void
remove()
Removes from the underlying collection the last element returned by the iterator (optional operation).V
setValue(V oValue)
Stores a new value at the current value index, returning the value that was replaced.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
m_iteratorInternal
protected LongArray.Iterator<V> m_iteratorInternal
The internal Iterator
-
-
Constructor Detail
-
UnmodifiableIterator
public UnmodifiableIterator(LongArray.Iterator<V> iterator)
Construct a wrapper for the specified Iterator.- Parameters:
iterator
- the iterator to create a wrapper for
-
-
Method Detail
-
getInternalIterator
public LongArray.Iterator<V> getInternalIterator()
Return the internal Iterator.- Returns:
- the internal Iterator
-
hasNext
public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)
-
next
public V next()
Returns the next element in the iteration.
-
getIndex
public long getIndex()
Returns the index of the current value, which is the value returned by the most recent call to the next method.- Specified by:
getIndex
in interfaceLongArray.Iterator<V>
- Returns:
- the index of the current value
-
getValue
public V getValue()
Returns the current value, which is the same value returned by the most recent call to the next method, or the most recent value passed to setValue if setValue were called after the next method.- Specified by:
getValue
in interfaceLongArray.Iterator<V>
- Returns:
- the current value
-
setValue
public V setValue(V oValue)
Stores a new value at the current value index, returning the value that was replaced. The index of the current value is obtainable by calling the getIndex method.- Specified by:
setValue
in interfaceLongArray.Iterator<V>
- Parameters:
oValue
- the new value to store- Returns:
- the replaced value
-
remove
public void remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
-
-