A buffering local adapter for the JCR-RMI RemoteIterator
interface. This class makes the remote iterator locally available
using the JCR RangeIterator
interface. The element arrays
returned by the remote iterator are buffered locally.
See the subclasses for type-specific versions of this abstract class.
@Deprecated public abstract class ClientIterator extends ClientObject implements RangeIterator
Constructor and Description |
---|
ClientIterator(RemoteIterator remote,
LocalAdapterFactory factory)
Deprecated.
Creates a local adapter for the given remote iterator.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
getObject(Object remote)
Deprecated.
Returns a local adapter for the given remote object.
|
long |
getPosition()
Deprecated.
Returns the current position within the iterator.
|
long |
getSize()
Deprecated.
Returns the size (the total number of elements) of this iteration.
|
boolean |
hasNext()
Deprecated.
Checks if there are more elements in this iteration.
|
Object |
next()
Deprecated.
Returns the next element in this iteration.
|
void |
remove()
Deprecated.
Not supported.
|
void |
skip(long skipNum)
Deprecated.
Skips the given number of elements in this iteration.
|
getFactory, getItem, getNode, getNodeTypeArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public ClientIterator(RemoteIterator remote, LocalAdapterFactory factory)
remote
- remote iteratorfactory
- local adapter factorypublic long getPosition()
getPosition
in interface RangeIterator
RangeIterator.getPosition()
public long getSize() throws RemoteRuntimeException
-1
if the size is unknown.
To minimize the number of remote method calls, the size is retrieved when this method is first called and cached for subsequent invocations.
getSize
in interface RangeIterator
-1
RemoteRuntimeException
- on RMI errorsRangeIterator.getSize()
public void skip(long skipNum) throws NoSuchElementException, RemoteRuntimeException
The elements in the local element buffer are skipped first, and a remote skip method call is made only if more elements are being skipped than remain in the local buffer.
skip
in interface RangeIterator
skipNum
- the number of elements to skipNoSuchElementException
- if skipped past the last elementRemoteRuntimeException
- on RMI errorsRangeIterator.skip(long)
public boolean hasNext() throws RemoteRuntimeException
hasNext
in interface Iterator
true
if there are more elements,
false
otherwiseRemoteRuntimeException
- on RMI errorsprotected abstract Object getObject(Object remote)
next()
to convert the remote references
returned by the remote iterator to local adapters.
Subclasses should implement this method to use the local adapter factory to create local adapters of the specific element type.
remote
- remote objectpublic Object next() throws NoSuchElementException, RemoteRuntimeException
next
in interface Iterator
NoSuchElementException
- if there are no more elementsRemoteRuntimeException
- on RMI errorspublic void remove() throws UnsupportedOperationException
remove
in interface Iterator
UnsupportedOperationException
- always thrownCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.