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

public class TableCell extends com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
Represents a single table cell within a table.
  • Constructor Details

    • TableCell

      public TableCell(int row, int col, boolean header, Rectangle2D bBox, com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock leafTextBlock, com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock textBlock)
  • Method Details

    • 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.
    • getType

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

      public boolean isLeaf()
      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, Images, and Tables are not leaves. A TableCell might be a leaf depending on its area compared to the page.
      Returns:
      boolean, indicating if a Node has direct access to a TextBlock
    • 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.
    • toString

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

      public static TableCell.TableCellBuilder<?,?> builder()
    • getRow

      public int getRow()
    • getCol

      public int getCol()
    • isHeader

      public boolean isHeader()
    • 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.
      Returns:
      AtomicTextBlock
    • setRow

      public void setRow(int row)
    • setCol

      public void setCol(int col)
    • setHeader

      public void setHeader(boolean header)
    • setBBox

      public void setBBox(Rectangle2D bBox)
    • 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.
      Parameters:
      leafTextBlock - the TextBlock to set as the LeafTextBlock of this SemanticNode
    • setTextBlock

      public void setTextBlock(com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock textBlock)
      Overrides:
      setTextBlock in class com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
    • 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