Class SerializableNode

    • Constructor Summary

      Constructors 
      Constructor Description
      SerializableNode()
      Builds an empty (invalid) node.
      SerializableNode​(int id, java.util.List<java.lang.Integer> subNodes, java.lang.String text)
      Builds a node.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(SerializableNode o)  
      boolean equals​(java.lang.Object obj)  
      int getId()
      Yields the id of this node.
      java.util.List<java.lang.Integer> getSubNodes()
      Yields the id of the nodes that are subnodes of this one, in the order they appear.
      java.lang.String getText()
      Yields the text of this node.
      int hashCode()  
      java.util.Map<java.lang.String,​java.lang.String> otherFields()
      Yields all fields that were unrecognized during deserialization.
      void setOtherField​(java.lang.String name, java.lang.String value)
      Adds a field that was not recognized during deserialization.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SerializableNode

        public SerializableNode()
        Builds an empty (invalid) node.
      • SerializableNode

        public SerializableNode​(int id,
                                java.util.List<java.lang.Integer> subNodes,
                                java.lang.String text)
        Builds a node.
        Parameters:
        id - the id of the node
        subNodes - the id of the nodes that are subnodes of this one, in the order they appear
        text - the text of this node
    • Method Detail

      • getId

        public int getId()
        Yields the id of this node.
        Returns:
        the id
      • getSubNodes

        public java.util.List<java.lang.Integer> getSubNodes()
        Yields the id of the nodes that are subnodes of this one, in the order they appear. Note that if node a contains node b, and b contains node c, then a.getSubNodes() returns only b, that is, the list is not recursive.
        Returns:
        the ids of the subnodes
      • getText

        public java.lang.String getText()
        Yields the text of this node.
        Returns:
        the text
      • otherFields

        public java.util.Map<java.lang.String,​java.lang.String> otherFields()
        Yields all fields that were unrecognized during deserialization.
        Returns:
        the other fields
      • setOtherField

        public void setOtherField​(java.lang.String name,
                                  java.lang.String value)
        Adds a field that was not recognized during deserialization.
        Parameters:
        name - he name of the field
        value - the value of the field
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object