Package uk.blankaspect.common.basictree
Class NullNode
java.lang.Object
uk.blankaspect.common.basictree.AbstractNode
uk.blankaspect.common.basictree.NullNode
- All Implemented Interfaces:
Cloneable
,ITreeNode<AbstractNode>
This class implements a node that represents a null value.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionNullNode()
Creates a new instance of a null node that has no parent.NullNode
(AbstractNode parent) Creates a new instance of a null node that has the specified parent. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a copy of this null node that has no parent.boolean
Returnstrue
if the specified object is an instance ofNullNode
.getType()
Returns the type of this node.int
hashCode()
Returns the hash code of this null node.boolean
Returnstrue
if this node can contain other nodes.toString()
Returns a string representation of this null node.Methods inherited from class uk.blankaspect.common.basictree.AbstractNode
getChildren, getListIndex, getMapKey, getParent, isRoot, setParent
-
Field Details
-
VALUE
The string representation of a null node.- See Also:
-
TYPE
The type of a null node.
-
-
Constructor Details
-
NullNode
public NullNode()Creates a new instance of a null node that has no parent. -
NullNode
Creates a new instance of a null node that has the specified parent.- Parameters:
parent
- the parent of the null node.
-
-
Method Details
-
getType
Description copied from class:AbstractNode
Returns the type of this node.- Specified by:
getType
in classAbstractNode
- Returns:
TYPE
.
-
isContainer
public boolean isContainer()Returnstrue
if this node can contain other nodes. For a null node, this method always returnsfalse
.- Specified by:
isContainer
in classAbstractNode
- Returns:
false
.
-
equals
Returnstrue
if the specified object is an instance ofNullNode
. -
hashCode
public int hashCode()Returns the hash code of this null node. -
clone
Creates and returns a copy of this null node that has no parent.- Overrides:
clone
in classAbstractNode
- Returns:
- a copy of this null node that has no parent.
-
toString
Returns a string representation of this null node.
-