-
- All Implemented Interfaces:
-
android.os.Parcelable,org.readium.r2.shared.JSONable
public final class Locator implements JSONable, Parcelable
Represents a precise location in a publication in a format that can be stored and shared.
There are many different use cases for locators:
getting back to the last position in a publication
bookmarks
highlights & annotations
search results
human-readable (and shareable) reference in a publication
https://readium.org/architecture/models/locators/
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classLocator.LocationsOne or more alternative expressions of the location. https://github.com/readium/architecture/tree/master/models/locators#the-location-object
public final classLocator.TextTextual context of the locator.
A Locator Text Object contains multiple text fragments, useful to give a context to the Locator or for highlights. https://github.com/readium/architecture/tree/master/models/locators#the-text-object
public classLocator.Companion
-
Constructor Summary
Constructors Constructor Description Locator(String href, String type, String title, Locator.Locations locations, Locator.Text text)Locator(Url href, MediaType mediaType, String title, Locator.Locations locations, Locator.Text text)
-
Method Summary
Modifier and Type Method Description final StringgetType()final UrlgetHref()final MediaTypegetMediaType()final StringgetTitle()final Locator.LocationsgetLocations()final Locator.TextgetText()final LocatorcopyWithLocations(List<String> fragments, Double progression, Integer position, Double totalProgression, Map<String, Object> otherLocations)Shortcut to get a copy of the Locator with different Locations sub-properties. JSONObjecttoJSON()Serializes the object to its JSON representation. -
-
Constructor Detail
-
Locator
Locator(String href, String type, String title, Locator.Locations locations, Locator.Text text)
-
Locator
Locator(Url href, MediaType mediaType, String title, Locator.Locations locations, Locator.Text text)
-
-
Method Detail
-
getMediaType
final MediaType getMediaType()
-
getLocations
final Locator.Locations getLocations()
-
getText
final Locator.Text getText()
-
copyWithLocations
final Locator copyWithLocations(List<String> fragments, Double progression, Integer position, Double totalProgression, Map<String, Object> otherLocations)
-
toJSON
JSONObject toJSON()
Serializes the object to its JSON representation.
-
-
-
-