Class Range
- java.lang.Object
-
- info.freelibrary.iiif.presentation.v3.Range
-
public class Range extends Object implements Resource<Range>
An ordered list of canvases and/or further ranges. Ranges allow canvases, or parts thereof, to be grouped together in some way. This could be for textual reasons, such as to distinguish books, chapters, verses, sections, non-content-bearing pages, the table of contents or similar. Equally, physical features might be important such as quires or gatherings, sections that have been added later and so forth.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Range.Item
A wrapper for the types of resources that can be put into a range's items:Canvas
,Range
, andSpecificResource
.
-
Constructor Summary
Constructors Constructor Description Range(Minter aMinter)
Creates a new range, using the supplied minter to create the range ID.Range(Minter aMinter, Label aLabel)
Creates a range from the supplied label, using the supplied minter to create the range' ID.Range(Minter aMinter, String aLabel)
Creates a range from the supplied label, using the supplied minter to create the range' ID.Range(String aID)
Creates a new range from the supplied ID.Range(String aID, Label aLabel)
Creates a new range from the supplied ID and label.Range(String aID, String aLabel)
Creates a new range from the supplied ID and label.Range(URI aID)
Creates a new range from the supplied ID.Range(URI aID, Label aLabel)
Creates a new range from the supplied ID and label.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Range
addBehaviors(Behavior... aBehaviorArray)
Adds behaviors to the resource.Range
addBehaviors(List<Behavior> aBehaviorList)
Adds behaviors to the resource.Range
clearBehaviors()
Removes the behaviors associated with this resource.Range
clearItems()
Clears the currently set items from this range.static Range
from(String aJsonString)
Returns a range from its JSON representation.Optional<AccompanyingCanvas>
getAccompanyingCanvas()
Gets the range's accompanying canvas.List<Behavior>
getBehaviors()
Gets the resource's behaviors in an unmodifiable list.List<Homepage>
getHomepages()
Gets a list of resource homepages, initializing the list if this hasn't been done already.URI
getID()
Gets the ID.List<Range.Item>
getItems()
Gets a list of the range's items.Label
getLabel()
Gets the label.List<Metadata>
getMetadata()
Gets the metadata.NavDate
getNavDate()
Gets a navigation date.List<PartOf>
getPartOfs()
Gets a list of resource partOfs, initializing the list if this hasn't been done already.Optional<PlaceholderCanvas>
getPlaceholderCanvas()
Gets the range's placeholder canvas.List<Provider>
getProviders()
Gets a list of resource providers, initializing the list if this hasn't been done already.List<Rendering>
getRenderings()
Gets a list of resource renderings, initializing the list if this hasn't been done already.RequiredStatement
getRequiredStatement()
Gets the required statement.URI
getRights()
Gets the rights.List<SeeAlso>
getSeeAlsoRefs()
Gets see also reference(s).List<Service<?>>
getServices()
Gets a list of resource services, initializing the list if this hasn't been done already.Optional<Start>
getStart()
Gets the range's optional start.Summary
getSummary()
Gets the summary.Optional<SupplementaryAnnotations>
getSupplementaryAnnotations()
Gets the supplementary annotations for this range.List<ContentResource<?>>
getThumbnails()
Gets a list of resource thumbnails, initializing the list if this hasn't been done already.String
getType()
Gets the type.ViewingDirection
getViewingDirection()
Gets the range's viewing direction.Range
setAccompanyingCanvas(AccompanyingCanvas aCanvas)
Sets the range's accompanying canvas.Range
setBehaviors(Behavior... aBehaviorArray)
Sets the behaviors for this resource.Range
setBehaviors(List<Behavior> aBehaviorList)
Sets the behaviors for this resource.Range
setHomepages(Homepage... aHomepageArray)
Sets the homepages for this resource.Range
setHomepages(List<Homepage> aHomepageList)
Sets the homepages for this resource.Range
setID(String aID)
Sets the resource ID from the supplied string.Range
setID(URI aID)
Sets the resource ID.Range
setItems(List<Range.Item> aItemList)
Sets the range's items.Range
setLabel(Label aLabel)
Sets the resource label.Range
setLabel(String aLabel)
Sets the resource label from the supplied string.Range
setMetadata(Metadata... aMetadataArray)
Sets the resource metadata.Range
setMetadata(List<Metadata> aMetadataList)
Sets the resource metadata.Range
setPartOfs(PartOf... aPartOfArray)
Sets the partOfs for this resource.Range
setPartOfs(List<PartOf> aPartOfList)
Sets the partOfs for this resource.Range
setPlaceholderCanvas(PlaceholderCanvas aCanvas)
Sets the range's placeholder canvasRange
setProviders(Provider... aProviderArray)
Sets the providers for this resource.Range
setProviders(List<Provider> aProviderList)
Sets the providers for this resource.Range
setRenderings(Rendering... aRenderingArray)
Sets the renderings for this resource.Range
setRenderings(List<Rendering> aRenderingList)
Sets the renderings for this resource.Range
setRequiredStatement(RequiredStatement aStatement)
Sets the resource's required statement.Range
setRights(String aRights)
Sets the resource's rights URI from the supplied string.Range
setRights(URI aRights)
Sets the resource's rights URI.Range
setSeeAlsoRefs(SeeAlso... aSeeAlsoArray)
Sets see also reference(s).Range
setSeeAlsoRefs(List<SeeAlso> aSeeAlsoList)
Sets see also reference(s).Range
setServices(Service<?>... aServiceArray)
Sets the services for this resource.Range
setServices(List<Service<?>> aServiceList)
Sets the services for this resource.Range
setStart(Start aStart)
Sets the range's optional start.Range
setSummary(Summary aSummary)
Sets the resource summary.Range
setSummary(String aSummary)
Sets the resource summary.Range
setSupplementaryAnnotations(SupplementaryAnnotations aAnnotationsCollection)
Sets the supplementary annotations for this range.Range
setThumbnails(ContentResource<?>... aThumbnailArray)
Sets the thumbnails for this resource.Range
setThumbnails(List<ContentResource<?>> aThumbnailList)
Sets the thumbnails for this resource.Range
setViewingDirection(ViewingDirection aViewingDirection)
Sets the range's viewing direction.String
toString()
Gets a string representation of a range.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface info.freelibrary.iiif.presentation.v3.Resource
getBehaviors, getHomepages, getID, getLabel, getMetadata, getPartOfs, getProviders, getRenderings, getRequiredStatement, getRights, getSeeAlsoRefs, getServices, getSummary, getThumbnails, getType
-
-
-
-
Constructor Detail
-
Range
public Range(String aID)
Creates a new range from the supplied ID.- Parameters:
aID
- A range ID in string form
-
Range
public Range(URI aID)
Creates a new range from the supplied ID.- Parameters:
aID
- A range ID
-
Range
public Range(String aID, String aLabel)
Creates a new range from the supplied ID and label.- Parameters:
aID
- A range ID in string formaLabel
- A descriptive label, in string form, for the range
-
Range
public Range(String aID, Label aLabel)
Creates a new range from the supplied ID and label.- Parameters:
aID
- A range ID in string formaLabel
- A descriptive label for the range
-
Range
public Range(URI aID, Label aLabel)
Creates a new range from the supplied ID and label.- Parameters:
aID
- A range IDaLabel
- A descriptive label for the range
-
Range
public Range(Minter aMinter)
Creates a new range, using the supplied minter to create the range ID.- Parameters:
aMinter
- A minter that should be used to get an ID for the range
-
Range
public Range(Minter aMinter, String aLabel)
Creates a range from the supplied label, using the supplied minter to create the range' ID.- Parameters:
aMinter
- A minter that will create the range IDaLabel
- A range label in string form
-
-
Method Detail
-
setSupplementaryAnnotations
public Range setSupplementaryAnnotations(SupplementaryAnnotations aAnnotationsCollection)
Sets the supplementary annotations for this range.- Parameters:
aAnnotationsCollection
- An annotation collection that supplements the range- Returns:
- The range
-
getSupplementaryAnnotations
public Optional<SupplementaryAnnotations> getSupplementaryAnnotations()
Gets the supplementary annotations for this range.- Returns:
- The annotation collection linked to this range
-
setProviders
public Range setProviders(Provider... aProviderArray)
Description copied from interface:Resource
Sets the providers for this resource.- Specified by:
setProviders
in interfaceResource<Range>
- Parameters:
aProviderArray
- The providers to set for this resource- Returns:
- The resource
-
setProviders
public Range setProviders(List<Provider> aProviderList)
Description copied from interface:Resource
Sets the providers for this resource.- Specified by:
setProviders
in interfaceResource<Range>
- Parameters:
aProviderList
- The providers to set for this resource- Returns:
- The resource
-
getPlaceholderCanvas
public Optional<PlaceholderCanvas> getPlaceholderCanvas()
Gets the range's placeholder canvas.- Returns:
- A placeholder canvas
-
setPlaceholderCanvas
public Range setPlaceholderCanvas(PlaceholderCanvas aCanvas)
Sets the range's placeholder canvas- Parameters:
aCanvas
- A placeholder canvas- Returns:
- This range
-
getAccompanyingCanvas
public Optional<AccompanyingCanvas> getAccompanyingCanvas()
Gets the range's accompanying canvas.- Returns:
- The accompanying canvas
-
setAccompanyingCanvas
public Range setAccompanyingCanvas(AccompanyingCanvas aCanvas)
Sets the range's accompanying canvas.- Parameters:
aCanvas
- An accompanying canvas- Returns:
- This range
-
clearBehaviors
public Range clearBehaviors()
Description copied from interface:Resource
Removes the behaviors associated with this resource.- Specified by:
clearBehaviors
in interfaceResource<Range>
- Returns:
- The resource
-
setBehaviors
public Range setBehaviors(Behavior... aBehaviorArray)
Description copied from interface:Resource
Sets the behaviors for this resource. Different types of resources allow different types of behaviors. For instance, on aManifest
resource thesetBehaviors(Behavior aBehavior)
method only allows a ManifestBehavior to be passed. If a CollectionBehavior, for instance, is passed, anIllegalArgumentException
will be thrown. Manifests, collections, canvases, and ranges have their own behaviors. Other resources use theResourceBehavior
class.- Specified by:
setBehaviors
in interfaceResource<Range>
- Parameters:
aBehaviorArray
- The behaviors to set for this resource- Returns:
- The resource
-
setBehaviors
public Range setBehaviors(List<Behavior> aBehaviorList)
Description copied from interface:Resource
Sets the behaviors for this resource. Different types of resources allow different types of behaviors. For instance, on aManifest
resource thesetBehaviors(List<Behavior> aBehaviorList)
method only allows a ManifestBehavior to be passed. If a CollectionBehavior, for instance, is passed, anIllegalArgumentException
will be thrown. Manifests, collections, canvases, and ranges have their own behaviors. Other resources use theResourceBehavior
class.- Specified by:
setBehaviors
in interfaceResource<Range>
- Parameters:
aBehaviorList
- The behaviors to set for this resource- Returns:
- The resource
-
addBehaviors
public Range addBehaviors(Behavior... aBehaviorArray)
Description copied from interface:Resource
Adds behaviors to the resource.- Specified by:
addBehaviors
in interfaceResource<Range>
- Parameters:
aBehaviorArray
- An array of behaviors to add to the resource- Returns:
- The resource
-
addBehaviors
public Range addBehaviors(List<Behavior> aBehaviorList)
Description copied from interface:Resource
Adds behaviors to the resource.- Specified by:
addBehaviors
in interfaceResource<Range>
- Parameters:
aBehaviorList
- A list of behaviors to add to the resource- Returns:
- The resource
-
setStart
public Range setStart(Start aStart)
Sets the range's optional start.- Parameters:
aStart
- A start- Returns:
- The range
-
getStart
public Optional<Start> getStart()
Gets the range's optional start.- Returns:
- The optional start
-
setViewingDirection
public Range setViewingDirection(ViewingDirection aViewingDirection)
Sets the range's viewing direction. To remove a viewing direction, set this value to null.- Parameters:
aViewingDirection
- A viewing direction- Returns:
- The range
-
getViewingDirection
public ViewingDirection getViewingDirection()
Gets the range's viewing direction.- Returns:
- The viewing direction
-
getItems
public List<Range.Item> getItems()
Gets a list of the range's items.- Returns:
- A list of range items
-
setItems
public Range setItems(List<Range.Item> aItemList)
Sets the range's items.- Parameters:
aItemList
- A list of items- Returns:
- This range
-
clearItems
public Range clearItems()
Clears the currently set items from this range.- Returns:
- The range
-
setSeeAlsoRefs
public Range setSeeAlsoRefs(SeeAlso... aSeeAlsoArray)
Description copied from interface:Resource
Sets see also reference(s).- Specified by:
setSeeAlsoRefs
in interfaceResource<Range>
- Parameters:
aSeeAlsoArray
- See also reference(s)- Returns:
- The resource
-
setSeeAlsoRefs
public Range setSeeAlsoRefs(List<SeeAlso> aSeeAlsoList)
Description copied from interface:Resource
Sets see also reference(s).- Specified by:
setSeeAlsoRefs
in interfaceResource<Range>
- Parameters:
aSeeAlsoList
- See also reference(s)- Returns:
- The resource
-
setServices
@SafeVarargs public final Range setServices(Service<?>... aServiceArray)
Description copied from interface:Resource
Sets the services for this resource.- Specified by:
setServices
in interfaceResource<Range>
- Parameters:
aServiceArray
- The services to set for this resource- Returns:
- The resource
-
setServices
public Range setServices(List<Service<?>> aServiceList)
Description copied from interface:Resource
Sets the services for this resource.- Specified by:
setServices
in interfaceResource<Range>
- Parameters:
aServiceList
- The services to set for this resource- Returns:
- The resource
-
setPartOfs
public Range setPartOfs(PartOf... aPartOfArray)
Description copied from interface:Resource
Sets the partOfs for this resource.- Specified by:
setPartOfs
in interfaceResource<Range>
- Parameters:
aPartOfArray
- The partOfs to set for this resource- Returns:
- The resource
-
setPartOfs
public Range setPartOfs(List<PartOf> aPartOfList)
Description copied from interface:Resource
Sets the partOfs for this resource.- Specified by:
setPartOfs
in interfaceResource<Range>
- Parameters:
aPartOfList
- The partOfs to set for this resource- Returns:
- The resource
-
setRenderings
public Range setRenderings(Rendering... aRenderingArray)
Description copied from interface:Resource
Sets the renderings for this resource.- Specified by:
setRenderings
in interfaceResource<Range>
- Parameters:
aRenderingArray
- The renderings to set for this resource- Returns:
- The resource
-
setRenderings
public Range setRenderings(List<Rendering> aRenderingList)
Description copied from interface:Resource
Sets the renderings for this resource.- Specified by:
setRenderings
in interfaceResource<Range>
- Parameters:
aRenderingList
- The renderings to set for this resource- Returns:
- The resource
-
setHomepages
public Range setHomepages(Homepage... aHomepageArray)
Description copied from interface:Resource
Sets the homepages for this resource.- Specified by:
setHomepages
in interfaceResource<Range>
- Parameters:
aHomepageArray
- The homepages to set for this resource- Returns:
- The resource
-
setHomepages
public Range setHomepages(List<Homepage> aHomepageList)
Description copied from interface:Resource
Sets the homepages for this resource.- Specified by:
setHomepages
in interfaceResource<Range>
- Parameters:
aHomepageList
- The homepages to set for this resource- Returns:
- The resource
-
setThumbnails
public Range setThumbnails(ContentResource<?>... aThumbnailArray)
Description copied from interface:Resource
Sets the thumbnails for this resource. A thumbnail can be any type of content resource, not justImageContent
.- Specified by:
setThumbnails
in interfaceResource<Range>
- Parameters:
aThumbnailArray
- The thumbnails to set for this resource- Returns:
- The resource
-
setThumbnails
public Range setThumbnails(List<ContentResource<?>> aThumbnailList)
Description copied from interface:Resource
Sets the thumbnails for this resource. A thumbnail can be any type of content resource, not justImageContent
.- Specified by:
setThumbnails
in interfaceResource<Range>
- Parameters:
aThumbnailList
- The thumbnails to set for this resource- Returns:
- The resource
-
setID
public Range setID(String aID)
Description copied from interface:Resource
Sets the resource ID from the supplied string.
-
setID
public Range setID(URI aID)
Description copied from interface:Resource
Sets the resource ID.
-
setRights
public Range setRights(String aRights)
Description copied from interface:Resource
Sets the resource's rights URI from the supplied string.
-
setRights
public Range setRights(URI aRights)
Description copied from interface:Resource
Sets the resource's rights URI.
-
setRequiredStatement
public Range setRequiredStatement(RequiredStatement aStatement)
Description copied from interface:Resource
Sets the resource's required statement.- Specified by:
setRequiredStatement
in interfaceResource<Range>
- Parameters:
aStatement
- A required statement- Returns:
- The resource
-
setSummary
public Range setSummary(String aSummary)
Description copied from interface:Resource
Sets the resource summary.- Specified by:
setSummary
in interfaceResource<Range>
- Parameters:
aSummary
- A summary in string form- Returns:
- The resource
-
setSummary
public Range setSummary(Summary aSummary)
Description copied from interface:Resource
Sets the resource summary.- Specified by:
setSummary
in interfaceResource<Range>
- Parameters:
aSummary
- A resource's summary- Returns:
- The resource
-
setMetadata
public Range setMetadata(Metadata... aMetadataArray)
Description copied from interface:Resource
Sets the resource metadata.- Specified by:
setMetadata
in interfaceResource<Range>
- Parameters:
aMetadataArray
- An array of metadata properties- Returns:
- The resource
-
setMetadata
public Range setMetadata(List<Metadata> aMetadataList)
Description copied from interface:Resource
Sets the resource metadata.- Specified by:
setMetadata
in interfaceResource<Range>
- Parameters:
aMetadataList
- A list of metadata properties- Returns:
- The resource
-
setLabel
public Range setLabel(String aLabel)
Description copied from interface:Resource
Sets the resource label from the supplied string.
-
setLabel
public Range setLabel(Label aLabel)
Description copied from interface:Resource
Sets the resource label.
-
toString
public String toString()
Gets a string representation of a range.
-
from
public static Range from(String aJsonString)
Returns a range from its JSON representation.- Parameters:
aJsonString
- A range in string form- Returns:
- The range
-
getNavDate
public NavDate getNavDate()
Gets a navigation date.- Returns:
- The navigation date
-
getLabel
public Label getLabel()
Gets the label.- Returns:
- The label
-
getSummary
public Summary getSummary()
Gets the summary.- Returns:
- The summary
-
getThumbnails
public List<ContentResource<?>> getThumbnails()
Gets a list of resource thumbnails, initializing the list if this hasn't been done already.- Returns:
- The resource's thumbnails
-
getRequiredStatement
public RequiredStatement getRequiredStatement()
Gets the required statement.- Returns:
- The required statement
-
getRights
public URI getRights()
Gets the rights.- Returns:
- The rights
-
getHomepages
public List<Homepage> getHomepages()
Gets a list of resource homepages, initializing the list if this hasn't been done already.- Returns:
- The resource's homepages
-
getProviders
public List<Provider> getProviders()
Gets a list of resource providers, initializing the list if this hasn't been done already.- Returns:
- The resource's providers
-
getRenderings
public List<Rendering> getRenderings()
Gets a list of resource renderings, initializing the list if this hasn't been done already.- Returns:
- The resource's renderings
-
getID
public URI getID()
Gets the ID.- Returns:
- The ID
-
getPartOfs
public List<PartOf> getPartOfs()
Gets a list of resource partOfs, initializing the list if this hasn't been done already.- Returns:
- The resource's partOfs
-
getType
public String getType()
Gets the type.- Returns:
- The type
-
getBehaviors
public List<Behavior> getBehaviors()
Gets the resource's behaviors in an unmodifiable list.- Returns:
- The resource's behaviors
-
getSeeAlsoRefs
public List<SeeAlso> getSeeAlsoRefs()
Gets see also reference(s).- Returns:
- The see also reference(s)
-
-