-
- All Implemented Interfaces:
-
android.os.Parcelable,org.readium.r2.shared.JSONable
public final class Locator.Locations implements JSONable, Parcelable
One or more alternative expressions of the location. https://github.com/readium/architecture/tree/master/models/locators#the-location-object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLocator.Locations.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Stringfragmentprivate final List<String>fragmentsprivate final Doubleprogressionprivate final Integerpositionprivate final DoubletotalProgressionprivate final Map<String, Object>otherLocations
-
Method Summary
Modifier and Type Method Description final StringgetFragment()final List<String>getFragments()final DoublegetProgression()final IntegergetPosition()final DoublegetTotalProgression()final Map<String, Object>getOtherLocations()JSONObjecttoJSON()Serializes the object to its JSON representation. final Objectget(String key)Syntactic sugar to access the otherLocations values by subscripting Locations directly. -
-
Constructor Detail
-
Locator.Locations
Locator.Locations(List<String> fragments, Double progression, Integer position, Double totalProgression, Map<String, Object> otherLocations)
- Parameters:
fragments- Contains one or more fragment in the resource referenced by the Locator.progression- Progression in the resource expressed as a percentage (between 0 and 1).position- An index in the publication (>= 1).totalProgression- Progression in the publication expressed as a percentage (between 0 and 1).otherLocations- Additional locations for extensions.
-
-
Method Detail
-
getFragment
final String getFragment()
-
getFragments
final List<String> getFragments()
-
getProgression
final Double getProgression()
-
getPosition
final Integer getPosition()
-
getTotalProgression
final Double getTotalProgression()
-
getOtherLocations
final Map<String, Object> getOtherLocations()
-
toJSON
JSONObject toJSON()
Serializes the object to its JSON representation.
-
get
final Object get(String key)
Syntactic sugar to access the otherLocations values by subscripting Locations directly.
locations["cssSelector"] == locations.otherLocations["cssSelector"]
-
-
-
-