A
- the actual type of AmetysObject
s.public class NodeIteratorIterable<A extends AmetysObject> extends Object implements AmetysObjectIterable<A>
AmetysObjectIterable
based on a underlying JCR NodeIterator
.AmetysObject
, an AmetysRepositoryException
will be thrown.AmetysObjectIterator.skip(long)
is called on the underlying Iterator,
results are buffered so that one may safely call iterator()
more than once,
even if the underlying NodeIterator
will be consumed only once.AmetysObjectIterator.skip(long)
is called, any subsequent call to iterator()
will throw an IllegalStateException
.Modifier and Type | Class and Description |
---|---|
(package private) class |
NodeIteratorIterable.NodeIteratorIterator |
Modifier and Type | Field and Description |
---|---|
(package private) List<A> |
_buffer |
private NodeIterator |
_iterator |
(package private) String |
_parentPath |
(package private) AmetysObjectResolver |
_resolver |
(package private) Session |
_session |
(package private) boolean |
_skipCalled |
Constructor and Description |
---|
NodeIteratorIterable(AmetysObjectResolver resolver,
NodeIterator iterator,
String parentPath,
Session session)
Creates a
NodeIteratorIterable . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the associated resources.
An AmetysObjectIterable must NOT be closed if any of the contained AmetysObject is still in use. |
long |
getSize()
Returns the number of elements in this iterable.
|
AmetysObjectIterator<A> |
iterator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
spliterator, stream
AmetysObjectResolver _resolver
String _parentPath
List<A extends AmetysObject> _buffer
boolean _skipCalled
private NodeIterator _iterator
public NodeIteratorIterable(AmetysObjectResolver resolver, NodeIterator iterator, String parentPath, Session session)
NodeIteratorIterable
.resolver
- the application AmetysObjectResolver
.iterator
- the underlying NodeIterator
.parentPath
- the parent path in the Ametys hierarchy of all
AmetysObject
being returned.session
- the JCR Session corresponding to the specified NodeIteratorpublic long getSize()
AmetysObjectIterable
getSize
in interface AmetysObjectIterable<A extends AmetysObject>
public AmetysObjectIterator<A> iterator()
iterator
in interface Iterable<A extends AmetysObject>
iterator
in interface AmetysObjectIterable<A extends AmetysObject>
public void close()
AmetysObjectIterable
AmetysObjectIterable
must NOT be closed if any of the contained AmetysObject
is still in use.close
in interface Closeable
close
in interface AutoCloseable
close
in interface AmetysObjectIterable<A extends AmetysObject>