Class AbstractNode<N extends AbstractNode<N>>
java.lang.Object
ch.nolix.base.document.node.AbstractNode<N>
- Type Parameters:
N- is the type of aAbstractNode.
- All Implemented Interfaces:
IOptionalHeaderHolder, INode<N>, BlanknessRequestable
- Direct Known Subclasses:
AbstractMutableNode, Node
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal booleancontainsChildNodeThat(Predicate<INode<?>> selector) final booleancontainsChildNodeWithHeader(String header) final booleanfinal booleanfinal intfinal intgetChildNodeCount(Predicate<INode<?>> selector) final IContainer<String> static StringgetEscapeStringFor(String string) getOptionalStoredFirstChildNodeThat(Predicate<INode<?>> selector) static StringgetOriginStringFromEscapeString(String escapeString) final booleanfinal doublefinal intfinal Stringfinal NgetStoredChildNodeAtOneBasedIndex(int index) final IContainer<N> getStoredChildNodesThat(Predicate<INode<?>> selector) final IContainer<N> getStoredChildNodesWithHeader(String header) final Nfinal NgetStoredFirstChildNodeThat(Predicate<INode<?>> selector) final Nfinal Nfinal inthashCode()final booleanisBlank()final voidsaveToFile(String path) Saves the currentAbstractNodeto the file with the given file path.final voidsaveToFile(String path, WriteMode writeMode) Saves the currentAbstractNodeto the file with the given path.final booleanfinal doubletoDouble()final Stringfinal inttoInt()final StringtoString()final IMutableXmlNodetoXml()Methods inherited from interface INode
asWithHeader, getStoredChildNodesMethods inherited from interface IOptionalHeaderHolder
getHeader, getHeaderOrEmptyString, getOptionalHeader, hasHeader, hasHeader
-
Field Details
-
COMMA_CODE
- See Also:
-
DOLLAR_SYMBOL_CODE
- See Also:
-
OPEN_BRACKET_CODE
- See Also:
-
CLOSED_BRACKET_CODE
- See Also:
-
-
Constructor Details
-
AbstractNode
public AbstractNode()
-
-
Method Details
-
getEscapeStringFor
-
getOriginStringFromEscapeString
- Parameters:
escapeString-- Returns:
- the origin
Stringfrom the given escapeString. - Throws:
NullPointerException- if the given escapeString is null.
-
containsChildNodes
public final boolean containsChildNodes()- Specified by:
containsChildNodesin interfaceINode<N extends AbstractNode<N>>- Returns:
- true if the current
INodecontains childINodes, false otherwise.
-
containsChildNodeThat
- Specified by:
containsChildNodeThatin interfaceINode<N extends AbstractNode<N>>- Parameters:
selector-- Returns:
- true if the current
INodecontains a childINodethe given selector selects, false otherwise.
-
containsChildNodeWithHeader
- Specified by:
containsChildNodeWithHeaderin interfaceINode<N extends AbstractNode<N>>- Parameters:
header-- Returns:
- true if the current
INodecontains a childINodewith the given header, false otherwise.
-
containsOneChildNode
public final boolean containsOneChildNode()- Specified by:
containsOneChildNodein interfaceINode<N extends AbstractNode<N>>- Returns:
- true if the current
INodecontains 1 childINode, false otherwise.
-
equals
-
getChildNodeCount
public final int getChildNodeCount()- Specified by:
getChildNodeCountin interfaceINode<N extends AbstractNode<N>>- Returns:
- the number of child
INodes of the currentINode.
-
getChildNodeCount
- Specified by:
getChildNodeCountin interfaceINode<N extends AbstractNode<N>>- Parameters:
selector-- Returns:
- the number of child
INodes the given selector selects from the currentINode.
-
getChildNodesHeaders
- Specified by:
getChildNodesHeadersin interfaceINode<N extends AbstractNode<N>>- Returns:
- the headers of the child
INodes of the currentINode.
-
getOptionalStoredFirstChildNodeThat
- Specified by:
getOptionalStoredFirstChildNodeThatin interfaceINode<N extends AbstractNode<N>>- Parameters:
selector-- Returns:
- a new
Optionalwith the first childINodethe given selector selects from the currentINode, an emptyOptionalotherwise.
-
getStoredChildNodeAtOneBasedIndex
- Specified by:
getStoredChildNodeAtOneBasedIndexin interfaceINode<N extends AbstractNode<N>>- Parameters:
index-- Returns:
- the child
INodeat the given oneBasedIndex from the currentINode.
-
getStoredChildNodesWithHeader
- Specified by:
getStoredChildNodesWithHeaderin interfaceINode<N extends AbstractNode<N>>- Parameters:
header-- Returns:
- the child
INodes with the given header from the currentINode.
-
getStoredChildNodesThat
- Specified by:
getStoredChildNodesThatin interfaceINode<N extends AbstractNode<N>>- Parameters:
selector-- Returns:
- the child
INodes the given selector selects from the currentINode.
-
getStoredFirstChildNode
- Specified by:
getStoredFirstChildNodein interfaceINode<N extends AbstractNode<N>>- Returns:
- the first child
INodefrom the currentINode.
-
getStoredSingleChildNode
- Specified by:
getStoredSingleChildNodein interfaceINode<N extends AbstractNode<N>>- Returns:
- the single child
INodeof the currentINode.
-
getStoredFirstChildNodeThat
- Specified by:
getStoredFirstChildNodeThatin interfaceINode<N extends AbstractNode<N>>- Parameters:
selector-- Returns:
- the first child
INodethe given selector selects from the currentINode.
-
getStoredFirstChildNodeWithHeader
- Specified by:
getStoredFirstChildNodeWithHeaderin interfaceINode<N extends AbstractNode<N>>- Parameters:
header-- Returns:
- the first child
INodewith the given header from the currentINode.
-
getSingleChildNodeAsBoolean
public final boolean getSingleChildNodeAsBoolean()- Specified by:
getSingleChildNodeAsBooleanin interfaceINode<N extends AbstractNode<N>>- Returns:
- the boolean the single child
INodeof the currentINoderepresents.
-
getSingleChildNodeAsDouble
public final double getSingleChildNodeAsDouble()- Specified by:
getSingleChildNodeAsDoublein interfaceINode<N extends AbstractNode<N>>- Returns:
- the double the single child
INodeof the currentINoderepresents.
-
getSingleChildNodeAsInt
public final int getSingleChildNodeAsInt()- Specified by:
getSingleChildNodeAsIntin interfaceINode<N extends AbstractNode<N>>- Returns:
- the int the single child
INodeof the currentINoderepresents.
-
getSingleChildNodeHeader
- Specified by:
getSingleChildNodeHeaderin interfaceINode<N extends AbstractNode<N>>- Returns:
- the header of the single child
INodeof the currentINode.
-
hashCode
-
isBlank
public final boolean isBlank()- Specified by:
isBlankin interfaceBlanknessRequestable- Returns:
- true if
BlanknessRequestableis blank, false otherwise.
-
saveToFile
Saves the currentAbstractNodeto the file with the given file path.- Parameters:
path-- Throws:
RuntimeException- if the given path is null.RuntimeException- if the given path is blank.RuntimeException- if there exists already a file system item with the given path.
-
saveToFile
Saves the currentAbstractNodeto the file with the given path.- Parameters:
path-writeMode-- Throws:
RuntimeException- if the given path is null.RuntimeException- if the given path is blank.RuntimeException- if the given writeMode flag=WriteMode.THROW_EXCEPTION_WHEN_TARGET_EXISTS_ALREADYand there exists already a file system item with the given path.
-
toBoolean
-
toDouble
-
toFormattedString
- Specified by:
toFormattedStringin interfaceINode<N extends AbstractNode<N>>- Returns:
- a formatted
Stringrepresentation of the currentINode.
-
toInt
-
toString
-
toXml
-