- java.lang.Object
-
- com.pervasive.datarush.analytics.text.TextElement
-
- com.pervasive.datarush.analytics.text.TextContainer
-
- All Implemented Interfaces:
TextNode
- Direct Known Subclasses:
TokenizedParagraph,TokenizedSentence,TokenizedText,TokenizedWord
public abstract class TextContainer extends TextElement implements TextNode
A tree node that can hold information on text elements.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<TextContainer>childrenprotected TextContainernextSiblingprotected TextContainerparentprotected TextContainerprevSibling
-
Constructor Summary
Constructors Modifier Constructor Description protectedTextContainer()Default constructor for empty text container.protectedTextContainer(TextElementType type, String value)Construct a container of element type with a specific value.protectedTextContainer(TextElementType type, List<? extends TextContainer> children)Construct a container of element type with the specified children.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)intgetChildCount()Get the number of direct children of this node.List<TextContainer>getChildren()Get the ordered list of direct children of this node.static TokenDecodergetDecoder()static TokenEncodergetEncoder()ListIterator<TextContainer>getIterator()Get an iterator over all descendants of this node including this node.ListIterator<TextContainer>getIterator(TextElementType type)Get an iterator over the node and all descendants of this node of the specified type.TextNodegetNextSibling()Get the right sibling of this node or null if this node has no right sibling.TextNodegetParent()Get the parent node of this node or null if this node is the root.ListIterator<TextContainer>getPostIterator()ListIterator<TextContainer>getPostIterator(TextElementType type)TextNodegetPrevSibling()Get the left sibling of this node or null if this node has no left sibling.inthashCode()StringtoString()-
Methods inherited from class com.pervasive.datarush.analytics.text.TextElement
getType, getValue
-
-
-
-
Field Detail
-
children
protected final List<TextContainer> children
-
parent
protected TextContainer parent
-
prevSibling
protected TextContainer prevSibling
-
nextSibling
protected TextContainer nextSibling
-
-
Constructor Detail
-
TextContainer
protected TextContainer()
Default constructor for empty text container.
-
TextContainer
protected TextContainer(TextElementType type, List<? extends TextContainer> children)
Construct a container of element type with the specified children.- Parameters:
type- the type of this text elementchildren- the children of this container
-
TextContainer
protected TextContainer(TextElementType type, String value)
Construct a container of element type with a specific value.- Parameters:
type- the type of this text elementvalue- the text value of this container
-
-
Method Detail
-
getChildCount
public int getChildCount()
Description copied from interface:TextNodeGet the number of direct children of this node.- Specified by:
getChildCountin interfaceTextNode- Returns:
- the child count of this node
-
getParent
public TextNode getParent()
Description copied from interface:TextNodeGet the parent node of this node or null if this node is the root.
-
getPrevSibling
public TextNode getPrevSibling()
Description copied from interface:TextNodeGet the left sibling of this node or null if this node has no left sibling.- Specified by:
getPrevSiblingin interfaceTextNode- Returns:
- the previous sibling node of this node
-
getNextSibling
public TextNode getNextSibling()
Description copied from interface:TextNodeGet the right sibling of this node or null if this node has no right sibling.- Specified by:
getNextSiblingin interfaceTextNode- Returns:
- the next sibling node of this node
-
getChildren
public List<TextContainer> getChildren()
Description copied from interface:TextNodeGet the ordered list of direct children of this node.- Specified by:
getChildrenin interfaceTextNode- Returns:
- a list of the child nodes
-
getIterator
public ListIterator<TextContainer> getIterator()
Description copied from interface:TextNodeGet an iterator over all descendants of this node including this node.- Specified by:
getIteratorin interfaceTextNode- Returns:
- a list iterator over the node and all descendants
-
getIterator
public ListIterator<TextContainer> getIterator(TextElementType type)
Description copied from interface:TextNodeGet an iterator over the node and all descendants of this node of the specified type.- Specified by:
getIteratorin interfaceTextNode- Parameters:
type- the type of nodes to iterate over- Returns:
- a list iterator over the selected nodes
-
getPostIterator
public ListIterator<TextContainer> getPostIterator()
-
getPostIterator
public ListIterator<TextContainer> getPostIterator(TextElementType type)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classTextElement
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classTextElement
-
getEncoder
public static TokenEncoder getEncoder()
-
getDecoder
public static TokenDecoder getDecoder()
-
-