java.lang.Object
com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
com.iqser.red.service.redaction.v1.server.model.document.nodes.Image
All Implemented Interfaces:
IEntity, com.iqser.red.service.redaction.v1.server.model.document.nodes.GenericSemanticNode, SemanticNode

public class Image extends com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode implements IEntity
Represents an image within the document.
  • Constructor Details

    • Image

      public Image(String id, com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock leafTextBlock, ImageType imageType, boolean transparent, Rectangle2D position, PriorityQueue<MatchedRule> matchedRuleList, com.iqser.red.service.redaction.v1.server.model.document.entity.ManualChangeOverwrite manualOverwrite, Page page)
    • Image

      public Image()
  • Method Details

    • getType

      public NodeType getType()
      Description copied from interface: SemanticNode
      Returns the type of this node, such as Section, Paragraph, etc.
      Specified by:
      getType in interface SemanticNode
      Returns:
      NodeType of this node
    • getTextBlock

      public com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock getTextBlock()
      Description copied from interface: SemanticNode
      Searches all Nodes located underneath this Node in the DocumentTree and concatenates their AtomicTextBlocks into a single TextBlock. So, for a Section all TextBlocks of Subsections, Paragraphs, and Tables are concatenated into a single TextBlock If the Node is a Leaf, the LeafTextBlock will be returned instead.
      Specified by:
      getTextBlock in interface SemanticNode
      Overrides:
      getTextBlock in class com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
      Returns:
      TextBlock containing all AtomicTextBlocks that are located under this Node.
    • getPages

      public Set<Page> getPages()
      Description copied from interface: SemanticNode
      Each AtomicTextBlock is assigned a page, so to get the pages this node appears on, it collects the PageNodes from each AtomicTextBlock belonging to this node's TextBlock.
      Specified by:
      getPages in interface SemanticNode
      Returns:
      Set of PageNodes this node appears on.
    • getTextRange

      public TextRange getTextRange()
      Description copied from interface: IEntity
      Gets the range of text in the document associated with this entity.
      Specified by:
      getTextRange in interface IEntity
      Specified by:
      getTextRange in interface SemanticNode
      Returns:
      The text range.
    • length

      public int length()
      Description copied from interface: IEntity
      Calculates the length of the entity's value.
      Specified by:
      length in interface IEntity
      Specified by:
      length in interface SemanticNode
      Returns:
      The length of the value.
    • type

      public String type()
      Description copied from interface: IEntity
      Gets the type of this entity.
      Specified by:
      type in interface IEntity
      Returns:
      The entity type.
    • toString

      public String toString()
      Overrides:
      toString in class com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
    • getBBox

      public Map<Page,Rectangle2D> getBBox()
      Description copied from interface: SemanticNode
      If this Node is a Leaf it will calculate the boundingBox of its LeafTextBlock, otherwise it will calculate the Union of the BoundingBoxes of all its Children. If called on the Document, it will return the cropbox of each page
      Specified by:
      getBBox in interface SemanticNode
      Overrides:
      getBBox in class com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
      Returns:
      Rectangle2D fully encapsulating this Node for each page.
    • getValue

      public String getValue()
      Description copied from interface: IEntity
      Gets the value of this entity as a string.
      Specified by:
      getValue in interface IEntity
      Returns:
      The string value.
    • mostlyContainedBy

      public boolean mostlyContainedBy(Image image, double containmentThreshold)
    • mostlyContains

      public boolean mostlyContains(Image image, double containmentThreshold)
    • builder

      public static Image.ImageBuilder<?,?> builder()
    • getId

      public String getId()
    • getLeafTextBlock

      public com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock getLeafTextBlock()
      Description copied from interface: SemanticNode
      Leaf means a SemanticNode has direct access to a TextBlock, by default this is false and must be overridden. Currently only Sections and Tables are no leaves.
      Specified by:
      getLeafTextBlock in interface SemanticNode
      Returns:
      AtomicTextBlock
    • getImageType

      public ImageType getImageType()
    • isTransparent

      public boolean isTransparent()
    • getPosition

      public Rectangle2D getPosition()
    • getMatchedRuleList

      public PriorityQueue<MatchedRule> getMatchedRuleList()
      Description copied from interface: IEntity
      Gets the list of rules matched against this entity.
      Specified by:
      getMatchedRuleList in interface IEntity
      Returns:
      A priority queue of matched rules.
    • getManualOverwrite

      public com.iqser.red.service.redaction.v1.server.model.document.entity.ManualChangeOverwrite getManualOverwrite()
      Description copied from interface: IEntity
      Gets the manual overwrite actions applied to this entity, if any.
      Specified by:
      getManualOverwrite in interface IEntity
      Returns:
      The manual overwrite details.
    • getPage

      public Page getPage()
    • setId

      public void setId(String id)
    • setLeafTextBlock

      public void setLeafTextBlock(com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock leafTextBlock)
      Description copied from interface: SemanticNode
      Should only be used during construction of the Graph. Sets the LeafTextBlock of this SemanticNode.
      Specified by:
      setLeafTextBlock in interface SemanticNode
      Parameters:
      leafTextBlock - the TextBlock to set as the LeafTextBlock of this SemanticNode
    • setImageType

      public void setImageType(ImageType imageType)
    • setTransparent

      public void setTransparent(boolean transparent)
    • setPosition

      public void setPosition(Rectangle2D position)
    • setMatchedRuleList

      public void setMatchedRuleList(PriorityQueue<MatchedRule> matchedRuleList)
    • setManualOverwrite

      public void setManualOverwrite(com.iqser.red.service.redaction.v1.server.model.document.entity.ManualChangeOverwrite manualOverwrite)
    • setPage

      public void setPage(Page page)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode