A simple array-based remote iterator. Used when the iteration is short enough for all the elements to be sent over the network in one go.
@Deprecated public class ArrayIterator extends Object implements RemoteIterator, Serializable
| Constructor and Description |
|---|
ArrayIterator(Object[] elements)
Deprecated.
Creates an array-based remote iterator from the given array
of remote references or serializable objects.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getSize()
Deprecated.
Returns the size of the iterator.
|
Object[] |
nextObjects()
Deprecated.
Returns the underlying array.
|
void |
skip(long items)
Deprecated.
Skips the first
items elements in the array. |
public ArrayIterator(Object[] elements)
elements - elements of the iterationpublic long getSize()
getSize in interface RemoteIteratorRemoteIterator.getSize()public void skip(long items)
throws IllegalArgumentException,
NoSuchElementException
items elements in the array.
Skips the given number of elements in this iteration.skip in interface RemoteIteratoritems - number of elements to skipNoSuchElementException - if skipped past the last elementIllegalArgumentExceptionRangeIterator.skip(long)public Object[] nextObjects() throws IllegalArgumentException
null if the end of this iteration has
been reached.
To reduce the amount of remote method calls, this method returns an array of one or more elements in this iteration.
nextObjects in interface RemoteIteratornullIllegalArgumentException - if maxItems is not positiveIterator.next()Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.