-
- All Implemented Interfaces:
-
org.readium.r2.shared.publication.services.content.Content.Iterator
public final class PublicationContentIterator implements Content.Iterator
A composite Content.Iterator which iterates through a whole manifest and delegates the iteration inside a given resource to media type-specific iterators.
-
-
Constructor Summary
Constructors Constructor Description PublicationContentIterator(Manifest manifest, Container<Resource> container, PublicationServicesHolder services, Locator startLocator, List<ResourceContentIteratorFactory> resourceContentIteratorFactories)
-
Method Summary
Modifier and Type Method Description BooleanhasPrevious()Returns true if the iterator has a previous element, suspending the caller while processing it. Content.Elementprevious()Retrieves the element computed by a preceding call to hasPrevious, or throws an IllegalStateException if hasPrevious was not invoked. BooleanhasNext()Returns true if the iterator has a next element, suspending the caller while processing it. Content.Elementnext()Retrieves the element computed by a preceding call to hasNext, or throws an IllegalStateException if hasNext was not invoked. -
-
Constructor Detail
-
PublicationContentIterator
PublicationContentIterator(Manifest manifest, Container<Resource> container, PublicationServicesHolder services, Locator startLocator, List<ResourceContentIteratorFactory> resourceContentIteratorFactories)
- Parameters:
manifest- The Manifest of the publication which will be iterated through.startLocator- Starting Locator in the publication.resourceContentIteratorFactories- List of ResourceContentIteratorFactory which will be used to create the iterator for each resource.
-
-
Method Detail
-
hasPrevious
Boolean hasPrevious()
Returns true if the iterator has a previous element, suspending the caller while processing it.
-
previous
Content.Element previous()
Retrieves the element computed by a preceding call to hasPrevious, or throws an IllegalStateException if hasPrevious was not invoked. This method should only be used in pair with hasPrevious.
-
hasNext
Boolean hasNext()
Returns true if the iterator has a next element, suspending the caller while processing it.
-
next
Content.Element next()
Retrieves the element computed by a preceding call to hasNext, or throws an IllegalStateException if hasNext was not invoked. This method should only be used in pair with hasNext.
-
-
-
-