Klasse ChainedNode
java.lang.Object
ch.nolix.core.document.chainednode.ChainedNode
- Alle implementierten Schnittstellen:
IOptionalHeaderHolder, IChainedNode, BlanknessRequestable
A
ChainedNode has the following attributes. -0 or 1 header -an
arbitrary number of child ChainedNodes -0 or 1 next
ChainedNode
A ChainedNode is not mutable.- Autor:
- Silvan Wyss
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates a newChainedNode.ChainedNode(String header, Iterable<INode<?>> attributes) Creates a newChainedNodewith the given header and attributes.ChainedNode(String header, Iterable<INode<?>> attributes, ChainedNode nextNode) Creates a newChainedNodewith the given header, attributes and nextNode. -
Methodenübersicht
Modifikator und TypMethodeBeschreibungbooleanbooleanstatic ChainedNodefromChainedNode(IChainedNode chainedNode) static ChainedNodestatic ChainedNodefromString(String string) getChildNodeAtOneBasedIndex(int index) intstatic StringgetEscapeStringFor(String string) getFirstChildNodeWithHeader(String header) doubleintstatic StringgetStoredginStringFromEscapeString(String escapeString) inthashCode()booleanbooleanbooleanisBlank()doubletoDouble()inttoInt()toNode()toString()static ChainedNodewithChildNodesFromNodes(INode<?> childNode, INode<?>... childNodes) static ChainedNodewithChildNodesFromNodes(Iterable<? extends INode<?>> attributes) Creates a newChainedNodewith the given attributes.static ChainedNodewithHeader(String header) static ChainedNodewithHeaderAndChildNode(String header, ChainedNode attribute) static ChainedNodewithHeaderAndChildNode(String header, INode<?> childNode) static ChainedNodewithHeaderAndChildNodes(String header, ChainedNode childNode, ChainedNode... childNodes) static ChainedNodewithHeaderAndChildNodes(String header, Iterable<? extends IChainedNode> attributes) static ChainedNodewithHeaderAndChildNodesFromNodes(String header, INode<?> childNode, INode<?>... childNodes) Creates a newChainedNodewith the given header and attributes.static ChainedNodewithHeaderAndChildNodesFromNodes(String header, Iterable<? extends INode<?>> attributes) Creates a newChainedNodewith the given header and attributes.static ChainedNodewithHeaderAndNextNode(String header, ChainedNode nextNode) static ChainedNodewithHeaderAndNextNodeAndChildNodes(String header, ChainedNode nextNode, IChainedNode childNode, IChainedNode... childNodes) Von Schnittstelle geerbte Methoden IOptionalHeaderHolder
getHeaderOrEmptyString, getOptionalHeader, hasHeader
-
Felddetails
-
DOT_CODE
- Siehe auch:
-
COMMA_CODE
- Siehe auch:
-
DOLLAR_SYMBOL_CODE
- Siehe auch:
-
OPEN_BRACKET_CODE
- Siehe auch:
-
CLOSED_BRACKET_CODE
- Siehe auch:
-
-
Konstruktordetails
-
ChainedNode
public ChainedNode()Creates a newChainedNode. -
ChainedNode
Creates a newChainedNodewith the given header and attributes.- Parameter:
header-attributes-- Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.
-
ChainedNode
Creates a newChainedNodewith the given header, attributes and nextNode.- Parameter:
header-attributes-nextNode-- Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.ArgumentIsNullException- if the given nextNode is null.
-
-
Methodendetails
-
fromChainedNode
- Parameter:
chainedNode-- Gibt zurück:
- a
ChainedNodefrom the given chainedNode. - Löst aus:
RuntimeException- if the given chainedNode is null.
-
fromNode
- Parameter:
node-- Gibt zurück:
- a new
ChainedNodefrom the given node.
-
fromString
- Parameter:
string-- Gibt zurück:
- a new
ChainedNodethe given string represents. - Löst aus:
UnrepresentingArgumentException- if the given string does not represent aChainedNode.
-
getEscapeStringFor
-
getStoredginStringFromEscapeString
-
withChildNodesFromNodes
- Parameter:
childNode-childNodes-- Gibt zurück:
- a new
ChainedNodewith the given childNodes. - Löst aus:
ArgumentIsNullException- if one of the given childNodes is null.
-
withChildNodesFromNodes
Creates a newChainedNodewith the given attributes.- Parameter:
attributes-- Gibt zurück:
- a new
ChainedNodewith the given attributes. - Löst aus:
ArgumentIsNullException- if one of the given attributes is null.
-
withHeader
- Parameter:
header-- Gibt zurück:
- a new
ChainedNodewith the given header. - Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.
-
withHeaderAndChildNode
- Parameter:
header-attribute-- Gibt zurück:
- a new
ChainedNodewith the given header and attribute. - Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.ArgumentIsNullException- if the given attribute is null.
-
withHeaderAndChildNodes
public static ChainedNode withHeaderAndChildNodes(String header, ChainedNode childNode, ChainedNode... childNodes) -
withHeaderAndChildNode
- Parameter:
header-childNode-- Gibt zurück:
- a new
ChainedNodewith the given header and childNode. - Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.
-
withHeaderAndChildNodes
public static ChainedNode withHeaderAndChildNodes(String header, Iterable<? extends IChainedNode> attributes) - Parameter:
header-attributes-- Gibt zurück:
- a new
ChainedNodewith the given header and attributes. - Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.ArgumentIsNullException- if one of the given attribute is null.
-
withHeaderAndChildNodesFromNodes
public static ChainedNode withHeaderAndChildNodesFromNodes(String header, INode<?> childNode, INode<?>... childNodes) Creates a newChainedNodewith the given header and attributes.- Parameter:
header-childNode-childNodes-- Gibt zurück:
- a new
ChainedNodewith the given header and attributes. - Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.ArgumentIsNullException- if one of the given attributes is null.
-
withHeaderAndChildNodesFromNodes
public static ChainedNode withHeaderAndChildNodesFromNodes(String header, Iterable<? extends INode<?>> attributes) Creates a newChainedNodewith the given header and attributes.- Parameter:
header-attributes-- Gibt zurück:
- a new
ChainedNodewith the given header and attributes. - Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.ArgumentIsNullException- if one of the given attributes is null.
-
withHeaderAndNextNode
- Parameter:
header-nextNode-- Gibt zurück:
- a new
ChainedNodewith the given header and nextNode. - Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.ArgumentIsNullException- if the given nextNode is null.
-
withHeaderAndNextNodeAndChildNodes
public static ChainedNode withHeaderAndNextNodeAndChildNodes(String header, ChainedNode nextNode, IChainedNode childNode, IChainedNode... childNodes) - Parameter:
header-nextNode-childNode-childNodes-- Gibt zurück:
- a new
ChainedNodewith the given header and nextNode. - Löst aus:
ArgumentIsNullException- if the given header is null.InvalidArgumentException- if the given header is blank.ArgumentIsNullException- if the given nextNode is null.ArgumentIsNullException- if one of the given childNodes is null.
-
containsChildNodes
public boolean containsChildNodes()- Angegeben von:
containsChildNodesin SchnittstelleIChainedNode- Gibt zurück:
- true if the current
IChainedNodecontains child nodes, false otherwise.
-
equals
-
getChildNodeCount
public int getChildNodeCount()- Angegeben von:
getChildNodeCountin SchnittstelleIChainedNode- Gibt zurück:
- the number of attributes of the current
ChainedNode.
-
getChildNodeAtOneBasedIndex
- Angegeben von:
getChildNodeAtOneBasedIndexin SchnittstelleIChainedNode- Parameter:
index-- Gibt zurück:
- the attribute at the given index of the current
ChainedNode. - Löst aus:
NonPositiveArgumentException- if the given index is not positive.ArgumentDoesNotHaveAttributeException- if the currentChainedNodedoes not contain an attribute at the given index.
-
getChildNodes
- Angegeben von:
getChildNodesin SchnittstelleIChainedNode- Gibt zurück:
- the attributes of the current
ChainedNode.
-
getFirstChildNodeWithHeader
- Angegeben von:
getFirstChildNodeWithHeaderin SchnittstelleIChainedNode- Parameter:
header-- Gibt zurück:
- the first attribute with the given header from the current
ChainedNode. - Löst aus:
ArgumentDoesNotHaveAttributeException- if the currentChainedNodedoes not contain an attribute with the given header.
-
getHeader
- Angegeben von:
getHeaderin SchnittstelleIOptionalHeaderHolder- Gibt zurück:
- the header of the current
ChainedNode. - Löst aus:
ArgumentDoesNotHaveAttributeException- if the currentChainedNodedoes not have a header.
-
getNextNode
- Angegeben von:
getNextNodein SchnittstelleIChainedNode- Gibt zurück:
- the next node of the current
ChainedNode. - Löst aus:
ArgumentDoesNotHaveAttributeException- if the currentChainedNodedoes not have a next node.
-
getSingleChildNode
- Angegeben von:
getSingleChildNodein SchnittstelleIChainedNode- Gibt zurück:
- the one attribute of the current
ChainedNode. - Löst aus:
EmptyArgumentException- if the currentChainedNodedoes not contain an attribute.InvalidArgumentException- if the currentChainedNodecontains several attributes.
-
getSingleChildNodeHeader
- Angegeben von:
getSingleChildNodeHeaderin SchnittstelleIChainedNode- Gibt zurück:
- the header of the single child node of the current
IChainedNode.
-
getSingleChildNodeAsDouble
public double getSingleChildNodeAsDouble()- Angegeben von:
getSingleChildNodeAsDoublein SchnittstelleIChainedNode- Gibt zurück:
- a double representation of the single child node of the current
IChainedNode.
-
getSingleChildNodeAsInt
public int getSingleChildNodeAsInt()- Angegeben von:
getSingleChildNodeAsIntin SchnittstelleIChainedNode- Gibt zurück:
- a int representation of the single child node of the current
IChainedNode.
-
getSingleChildNodeAsString
- Angegeben von:
getSingleChildNodeAsStringin SchnittstelleIChainedNode- Gibt zurück:
- a
Stringrepresentation of the single child node of the currentIChainedNode.
-
hashCode
-
hasHeader
public boolean hasHeader()- Angegeben von:
hasHeaderin SchnittstelleIOptionalHeaderHolder- Gibt zurück:
- true if the current
IOptionalHeaderHolderhas a header, false otherwise.
-
hasNextNode
public boolean hasNextNode()- Angegeben von:
hasNextNodein SchnittstelleIChainedNode- Gibt zurück:
- true if the current
IChainedNodehas a next node, false otherwise.
-
isBlank
public boolean isBlank()- Angegeben von:
isBlankin SchnittstelleBlanknessRequestable- Gibt zurück:
- true if
BlanknessRequestableis blank, false otherwise.
-
toDouble
public double toDouble()- Angegeben von:
toDoublein SchnittstelleIChainedNode- Gibt zurück:
- the double the current
IChainedNoderepresents.
-
toInt
public int toInt()- Angegeben von:
toIntin SchnittstelleIChainedNode- Gibt zurück:
- the int the current
IChainedNoderepresents.
-
toNode
AIChainedNoderepresents aINodeif: -TheIChainedNodedoes not have a next node. -Each child nodes of theIChainedNoderepresents aINode.- Angegeben von:
toNodein SchnittstelleIChainedNode- Gibt zurück:
- a
INoderepresentation of the currentIChainedNode.
-
toString
-