Class NullNode

java.lang.Object
uk.blankaspect.common.basictree.AbstractNode
uk.blankaspect.common.basictree.NullNode
All Implemented Interfaces:
Cloneable, ITreeNode<AbstractNode>

public class NullNode extends AbstractNode
This class implements a node that represents a null value.
  • Field Details

    • VALUE

      public static final String VALUE
      The string representation of a null node.
      See Also:
    • TYPE

      public static final NodeType 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

      public NullNode(AbstractNode parent)
      Creates a new instance of a null node that has the specified parent.
      Parameters:
      parent - the parent of the null node.
  • Method Details

    • getType

      public NodeType getType()
      Description copied from class: AbstractNode
      Returns the type of this node.
      Specified by:
      getType in class AbstractNode
      Returns:
      TYPE.
    • isContainer

      public boolean isContainer()
      Returns true if this node can contain other nodes. For a null node, this method always returns false.
      Specified by:
      isContainer in class AbstractNode
      Returns:
      false.
    • equals

      public boolean equals(Object obj)
      Returns true if the specified object is an instance of NullNode.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object with which this null node will be compared.
      Returns:
      true if obj is an instance of NullNode; false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash code of this null node.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code of this null node.
    • clone

      public NullNode clone()
      Creates and returns a copy of this null node that has no parent.
      Overrides:
      clone in class AbstractNode
      Returns:
      a copy of this null node that has no parent.
    • toString

      public String toString()
      Returns a string representation of this null node.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this null node.