-
- All Implemented Interfaces:
-
org.readium.r2.shared.publication.services.content.Content.Iterator
public final class HtmlResourceContentIterator implements Content.Iterator
Iterates an HTML resource, starting from the given locator.
If you want to start mid-resource, the locator must contain a
cssSelectorkey in its Locator.Locations object.If you want to start from the end of the resource, the locator must have a
progressionof 1.0.Locators will contain a
beforecontext of up tobeforeMaxLengthcharacters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classHtmlResourceContentIterator.Factorypublic final classHtmlResourceContentIterator.ParsedElementsHolds the result of parsing the HTML resource into a list of Content.Element.
The startIndex will be calculated from the element matched by the base locator, if possible. Defaults to 0.
-
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. -
-
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.
-
-
-
-