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 ChainedNode
s -0 or 1 next
ChainedNode
A ChainedNode
is not mutable.- Version:
- 2016-01-01
- Autor:
- Silvan Wyss
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates a newChainedNode
.ChainedNode
(String header, Iterable<INode<?>> attributes) Creates a newChainedNode
with the given header and attributes.ChainedNode
(String header, Iterable<INode<?>> attributes, ChainedNode nextNode) Creates a newChainedNode
with the given header, attributes and nextNode. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
boolean
static ChainedNode
fromChainedNode
(IChainedNode chainedNode) static ChainedNode
static ChainedNode
fromString
(String string) getChildNodeAt1BasedIndex
(int index) int
static String
getEscapeStringFor
(String string) getFirstChildNodeWithHeader
(String header) double
int
static String
getStoredginStringFromEscapeString
(String escapeString) int
hashCode()
boolean
boolean
boolean
isBlank()
double
toDouble()
int
toInt()
toNode()
toString()
static ChainedNode
withChildNodesFromNodes
(INode<?> childNode, INode<?>... childNodes) static ChainedNode
withChildNodesFromNodes
(Iterable<? extends INode<?>> attributes) Creates a newChainedNode
with the given attributes.static ChainedNode
withHeader
(String header) static ChainedNode
withHeaderAndChildNode
(String header, ChainedNode attribute) static ChainedNode
withHeaderAndChildNode
(String header, INode<?> childNode) static ChainedNode
withHeaderAndChildNodes
(String header, ChainedNode childNode, ChainedNode... childNodes) static ChainedNode
withHeaderAndChildNodes
(String header, Iterable<? extends IChainedNode> attributes) static ChainedNode
withHeaderAndChildNodesFromNodes
(String header, INode<?> childNode, INode<?>... childNodes) Creates a newChainedNode
with the given header and attributes.static ChainedNode
withHeaderAndChildNodesFromNodes
(String header, Iterable<? extends INode<?>> attributes) Creates a newChainedNode
with the given header and attributes.static ChainedNode
withHeaderAndNextNode
(String header, ChainedNode nextNode) static ChainedNode
withHeaderAndNextNodeAndChildNodes
(String header, ChainedNode nextNode, IChainedNode childNode, IChainedNode... childNodes) Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.attributeapi.optionalattributeapi.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 newChainedNode
with 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 newChainedNode
with 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
ChainedNode
from the given chainedNode. - Löst aus:
RuntimeException
- if the given chainedNode is null.
-
fromNode
- Parameter:
node
-- Gibt zurück:
- a new
ChainedNode
from the given node.
-
fromString
- Parameter:
string
-- Gibt zurück:
- a new
ChainedNode
the given string represents. - Löst aus:
UnrepresentingArgumentException
- if the given string does not represent aChainedNode
.
-
getEscapeStringFor
- Parameter:
string
-- Gibt zurück:
- an escape
String
for the given string.
-
getStoredginStringFromEscapeString
- Parameter:
escapeString
-- Gibt zurück:
- an origin
String
from the given escapeString.
-
withChildNodesFromNodes
- Parameter:
childNode
-childNodes
-- Gibt zurück:
- a new
ChainedNode
with the given childNodes. - Löst aus:
ArgumentIsNullException
- if one of the given childNodes is null.
-
withChildNodesFromNodes
Creates a newChainedNode
with the given attributes.- Parameter:
attributes
-- Gibt zurück:
- a new
ChainedNode
with the given attributes. - Löst aus:
ArgumentIsNullException
- if one of the given attributes is null.
-
withHeader
- Parameter:
header
-- Gibt zurück:
- a new
ChainedNode
with 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
ChainedNode
with 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
ChainedNode
with 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
ChainedNode
with 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 newChainedNode
with the given header and attributes.- Parameter:
header
-childNode
-childNodes
-- Gibt zurück:
- a new
ChainedNode
with 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 newChainedNode
with the given header and attributes.- Parameter:
header
-attributes
-- Gibt zurück:
- a new
ChainedNode
with 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
ChainedNode
with 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
ChainedNode
with 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:
containsChildNodes
in SchnittstelleIChainedNode
- Gibt zurück:
- true if the current
IChainedNode
contains child nodes.
-
equals
-
getChildNodeCount
public int getChildNodeCount()- Angegeben von:
getChildNodeCount
in SchnittstelleIChainedNode
- Gibt zurück:
- the number of attributes of the current
ChainedNode
.
-
getChildNodeAt1BasedIndex
- Angegeben von:
getChildNodeAt1BasedIndex
in 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 currentChainedNode
does not contain an attribute at the given index.
-
getChildNodes
- Angegeben von:
getChildNodes
in SchnittstelleIChainedNode
- Gibt zurück:
- the attributes of the current
ChainedNode
.
-
getFirstChildNodeWithHeader
- Angegeben von:
getFirstChildNodeWithHeader
in SchnittstelleIChainedNode
- Parameter:
header
-- Gibt zurück:
- the first attribute with the given header from the current
ChainedNode
. - Löst aus:
ArgumentDoesNotHaveAttributeException
- if the currentChainedNode
does not contain an attribute with the given header.
-
getHeader
- Angegeben von:
getHeader
in SchnittstelleIOptionalHeaderHolder
- Gibt zurück:
- the header of the current
ChainedNode
. - Löst aus:
ArgumentDoesNotHaveAttributeException
- if the currentChainedNode
does not have a header.
-
getNextNode
- Angegeben von:
getNextNode
in SchnittstelleIChainedNode
- Gibt zurück:
- the next node of the current
ChainedNode
. - Löst aus:
ArgumentDoesNotHaveAttributeException
- if the currentChainedNode
does not have a next node.
-
getSingleChildNode
- Angegeben von:
getSingleChildNode
in SchnittstelleIChainedNode
- Gibt zurück:
- the one attribute of the current
ChainedNode
. - Löst aus:
EmptyArgumentException
- if the currentChainedNode
does not contain an attribute.InvalidArgumentException
- if the currentChainedNode
contains several attributes.
-
getSingleChildNodeHeader
- Angegeben von:
getSingleChildNodeHeader
in SchnittstelleIChainedNode
- Gibt zurück:
- the header of the single child node of the current
IChainedNode
.
-
getSingleChildNodeAsDouble
public double getSingleChildNodeAsDouble()- Angegeben von:
getSingleChildNodeAsDouble
in SchnittstelleIChainedNode
- Gibt zurück:
- a double representation of the single child node of the current
IChainedNode
.
-
getSingleChildNodeAsInt
public int getSingleChildNodeAsInt()- Angegeben von:
getSingleChildNodeAsInt
in SchnittstelleIChainedNode
- Gibt zurück:
- a int representation of the single child node of the current
IChainedNode
.
-
getSingleChildNodeAsString
- Angegeben von:
getSingleChildNodeAsString
in SchnittstelleIChainedNode
- Gibt zurück:
- a
String
representation of the single child node of the currentIChainedNode
.
-
hashCode
public int hashCode() -
hasHeader
public boolean hasHeader()- Angegeben von:
hasHeader
in SchnittstelleIOptionalHeaderHolder
- Gibt zurück:
- true if the current
IOptionalHeaderHolder
has a header.
-
hasNextNode
public boolean hasNextNode()- Angegeben von:
hasNextNode
in SchnittstelleIChainedNode
- Gibt zurück:
- true if the current
ChainedNode
has a next node.
-
isBlank
public boolean isBlank()- Angegeben von:
isBlank
in SchnittstelleBlanknessRequestable
- Gibt zurück:
- true if the current
ChainedNode
does not have a header and does not contains attributes.
-
toDouble
public double toDouble()- Angegeben von:
toDouble
in SchnittstelleIChainedNode
- Gibt zurück:
- a
Double
representation of the currentChainedNode
. - Löst aus:
UnrepresentingArgumentException
- if the currentChainedNode
does not represent aDouble
.
-
toInt
public int toInt()- Angegeben von:
toInt
in SchnittstelleIChainedNode
- Gibt zurück:
- the int the current
IChainedNode
represents.
-
toNode
AChainedNode
represents aNode
if: -TheChainedNode
does not have a next node. -Each attribute of theChainedNode
represents aNode
.- Angegeben von:
toNode
in SchnittstelleIChainedNode
- Gibt zurück:
- a
Node
representation of the currentChainedNode
. - Löst aus:
UnrepresentingArgumentException
- if the currentChainedNode
does not represent aNode
.
-
toString
-