Class Image
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Image.ImageBuilder<C extends Image,
B extends Image.ImageBuilder<C, B>> Nested classes/interfaces inherited from class com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode.AbstractSemanticNodeBuilder<C extends com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode,
B extends com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode.AbstractSemanticNodeBuilder<C, B>> -
Constructor Summary
ConstructorsConstructorDescriptionImage()
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) -
Method Summary
Modifier and TypeMethodDescriptionstatic Image.ImageBuilder<?,
?> builder()
boolean
getBBox()
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.getId()
com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock
Leaf means a SemanticNode has direct access to a TextBlock, by default this is false and must be overridden.com.iqser.red.service.redaction.v1.server.model.document.entity.ManualChangeOverwrite
Gets the manual overwrite actions applied to this entity, if any.Gets the list of rules matched against this entity.getPage()
getPages()
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.com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock
Searches all Nodes located underneath this Node in the DocumentTree and concatenates their AtomicTextBlocks into a single TextBlock.Gets the range of text in the document associated with this entity.getType()
Returns the type of this node, such as Section, Paragraph, etc.getValue()
Gets the value of this entity as a string.int
hashCode()
boolean
int
length()
Calculates the length of the entity's value.boolean
mostlyContainedBy
(Image image, double containmentThreshold) boolean
mostlyContains
(Image image, double containmentThreshold) void
void
setImageType
(ImageType imageType) void
setLeafTextBlock
(com.iqser.red.service.redaction.v1.server.model.document.textblock.TextBlock leafTextBlock) Should only be used during construction of the Graph.void
setManualOverwrite
(com.iqser.red.service.redaction.v1.server.model.document.entity.ManualChangeOverwrite manualOverwrite) void
setMatchedRuleList
(PriorityQueue<MatchedRule> matchedRuleList) void
void
setPosition
(Rectangle2D position) void
setTransparent
(boolean transparent) toString()
type()
Gets the type of this entity.Methods inherited from class com.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
getBBoxCache, getDocumentTree, getEngines, getEntities, getTreeId, setBBoxCache, setDocumentTree, setEngines, setEntities, setTextBlock, setTreeId
Methods inherited from interface com.iqser.red.service.redaction.v1.server.model.document.entity.IEntity
active, addMatchedRule, addMatchedRules, applied, apply, apply, applyWithLineBreaks, applyWithReferences, buildReasonWithManualChangeDescriptions, getMatchedRule, getMatchedRuleUnit, hasManualChanges, ignore, ignored, legalBasis, redact, references, remove, removed, resized, skip, skipped, skipWithReferences, valid, value
Methods inherited from interface com.iqser.red.service.redaction.v1.server.model.document.nodes.SemanticNode
accept, addEngine, addThisToEntityIfIntersects, containsAllStrings, containsAllStringsIgnoreCase, containsAllWords, containsAllWordsIgnoreCase, containsAnyString, containsAnyString, containsAnyStringIgnoreCase, containsAnyWord, containsAnyWordIgnoreCase, containsRectangle, containsString, containsStringIgnoreCase, containsWord, containsWordIgnoreCase, getEntitiesOfType, getEntitiesOfType, getEntitiesOfType, getFirstPage, getHeadline, getHighestParent, getNextSibling, getNumberOnPage, getPages, getParent, getPositionsPerPage, getPreviousSibling, getSectionIdentifier, getTextBlocksByPageNumbers, hasEntitiesOfAllTypes, hasEntitiesOfAnyType, hasEntitiesOfType, hasParent, hasText, intersectsRectangle, isLeaf, matchesRegex, matchesRegexIgnoreCase, onlyOnPage, onPage, streamAllSubNodes, streamAllSubNodesOfType, streamChildren, streamChildrenOfType, streamValidEntities
-
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
Description copied from interface:SemanticNode
Returns the type of this node, such as Section, Paragraph, etc.- Specified by:
getType
in interfaceSemanticNode
- 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 interfaceSemanticNode
- Overrides:
getTextBlock
in classcom.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
- Returns:
- TextBlock containing all AtomicTextBlocks that are located under this Node.
-
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 interfaceSemanticNode
- Returns:
- Set of PageNodes this node appears on.
-
getTextRange
Description copied from interface:IEntity
Gets the range of text in the document associated with this entity.- Specified by:
getTextRange
in interfaceIEntity
- Specified by:
getTextRange
in interfaceSemanticNode
- 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 interfaceIEntity
- Specified by:
length
in interfaceSemanticNode
- Returns:
- The length of the value.
-
type
Description copied from interface:IEntity
Gets the type of this entity. -
toString
- Overrides:
toString
in classcom.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
-
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 interfaceSemanticNode
- Overrides:
getBBox
in classcom.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
- Returns:
- Rectangle2D fully encapsulating this Node for each page.
-
getValue
Description copied from interface:IEntity
Gets the value of this entity as a string. -
mostlyContainedBy
-
mostlyContains
-
builder
-
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 interfaceSemanticNode
- Returns:
- AtomicTextBlock
-
getImageType
-
isTransparent
public boolean isTransparent() -
getPosition
-
getMatchedRuleList
Description copied from interface:IEntity
Gets the list of rules matched against this entity.- Specified by:
getMatchedRuleList
in interfaceIEntity
- 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 interfaceIEntity
- Returns:
- The manual overwrite details.
-
getPage
-
setId
-
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 interfaceSemanticNode
- Parameters:
leafTextBlock
- the TextBlock to set as the LeafTextBlock of this SemanticNode
-
setImageType
-
setTransparent
public void setTransparent(boolean transparent) -
setPosition
-
setMatchedRuleList
-
setManualOverwrite
public void setManualOverwrite(com.iqser.red.service.redaction.v1.server.model.document.entity.ManualChangeOverwrite manualOverwrite) -
setPage
-
equals
- Overrides:
equals
in classcom.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
-
hashCode
public int hashCode()- Overrides:
hashCode
in classcom.iqser.red.service.redaction.v1.server.model.document.nodes.AbstractSemanticNode
-