Class Range

  • All Implemented Interfaces:
    Resource<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.
    • 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 form
        aLabel - 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 form
        aLabel - 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 ID
        aLabel - 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 ID
        aLabel - A range label in string form
      • Range

        public Range​(Minter aMinter,
                     Label 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 ID
        aLabel - A range label
    • 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 interface Resource<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 interface Resource<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 interface Resource<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 a Manifest resource the setBehaviors(Behavior aBehavior) method only allows a ManifestBehavior to be passed. If a CollectionBehavior, for instance, is passed, an IllegalArgumentException will be thrown. Manifests, collections, canvases, and ranges have their own behaviors. Other resources use the ResourceBehavior class.
        Specified by:
        setBehaviors in interface Resource<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 a Manifest resource the setBehaviors(List<Behavior> aBehaviorList) method only allows a ManifestBehavior to be passed. If a CollectionBehavior, for instance, is passed, an IllegalArgumentException will be thrown. Manifests, collections, canvases, and ranges have their own behaviors. Other resources use the ResourceBehavior class.
        Specified by:
        setBehaviors in interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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 just ImageContent.
        Specified by:
        setThumbnails in interface Resource<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 just ImageContent.
        Specified by:
        setThumbnails in interface Resource<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.
        Specified by:
        setID in interface Resource<Range>
        Parameters:
        aID - A resource ID in string form
        Returns:
        The resource
      • setID

        public Range setID​(URI aID)
        Description copied from interface: Resource
        Sets the resource ID.
        Specified by:
        setID in interface Resource<Range>
        Parameters:
        aID - A resource ID
        Returns:
        The resource
      • setRights

        public Range setRights​(String aRights)
        Description copied from interface: Resource
        Sets the resource's rights URI from the supplied string.
        Specified by:
        setRights in interface Resource<Range>
        Parameters:
        aRights - A resource's rights URI in string form
        Returns:
        The resource
      • setRights

        public Range setRights​(URI aRights)
        Description copied from interface: Resource
        Sets the resource's rights URI.
        Specified by:
        setRights in interface Resource<Range>
        Parameters:
        aRights - A rights URI
        Returns:
        The resource
      • setSummary

        public Range setSummary​(String aSummary)
        Description copied from interface: Resource
        Sets the resource summary.
        Specified by:
        setSummary in interface Resource<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 interface Resource<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 interface Resource<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 interface Resource<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.
        Specified by:
        setLabel in interface Resource<Range>
        Parameters:
        aLabel - The string form of the label to set
        Returns:
        The resource
      • setLabel

        public Range setLabel​(Label aLabel)
        Description copied from interface: Resource
        Sets the resource label.
        Specified by:
        setLabel in interface Resource<Range>
        Parameters:
        aLabel - The resource's label
        Returns:
        The resource
      • toString

        public String toString()
        Gets a string representation of a range.
        Overrides:
        toString in class Object
        Returns:
        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
      • getMetadata

        public List<Metadata> getMetadata()
        Gets the metadata.
        Returns:
        The metadata
      • 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)
      • getServices

        public List<Service<?>> getServices()
        Gets a list of resource services, initializing the list if this hasn't been done already.
        Returns:
        The resource's services