Class DocumentReference

java.lang.Object
io.goobi.viewer.api.rest.model.ner.DocumentReference

public class DocumentReference extends Object
REST API model representing a digitized document identified by its persistent identifier (PI), together with the NER tag groups found across its pages. Page ranges are kept in sorted order and are accessible both as a whole list and by individual page order number.
  • Constructor Details

    • DocumentReference

      public DocumentReference()
      Creates a new DocumentReference instance.
    • DocumentReference

      public DocumentReference(String piTopStruct)
      Creates a new DocumentReference instance.
      Parameters:
      piTopStruct - persistent identifier of the top-level structure
  • Method Details

    • getPi

      public String getPi()
      Getter for the field pi.
      Returns:
      the persistent identifier (PI) of the top-level structure element
    • setPageRanges

      public void setPageRanges(List<TagGroup> ranges)
      Setter for the field pageRanges.
      Parameters:
      ranges - sorted list of tag groups to set
    • addPageRange

      public void addPageRange(TagGroup range)
      addPageRange.
      Parameters:
      range - tag group representing a page range to add
    • addPageRanges

      public void addPageRanges(Collection<TagGroup> ranges)
      addPageRanges.
      Parameters:
      ranges - collection of tag groups to add
    • getPageRanges

      public List<TagGroup> getPageRanges()
      Getter for the field pageRanges.
      Returns:
      a list of tag groups, one per page range in this document reference
    • getPageRange

      public TagGroup getPageRange(int startPage)
      getPageRange.
      Parameters:
      startPage - page order number to look up in ranges
      Returns:
      the TagGroup whose range contains the given start page, or null if none found
    • getRangeSize

      public int getRangeSize()
      getRangeSize.
      Returns:
      a int.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object