Class Node

    • Constructor Detail

      • Node

        public Node()
        Creates a new Node.
    • Method Detail

      • fromFile

        public static Node fromFile​(java.lang.String filePath)
        Parameters:
        filePath -
        Returns:
        a new Node from the file with the given file path.
        Throws:
        InvalidArgumentException - if the given file path is not valid.
        InvalidArgumentException - if the file with the given file path does not represent a Node.
      • fromIntPair

        public static Node fromIntPair​(IntPair intPair)
        Parameters:
        intPair -
        Returns:
        a new Node from the given intPair.
        Throws:
        ArgumentIsNullException - if the given intPair is null.
      • fromString

        public static Node fromString​(java.lang.String string)
        Parameters:
        string -
        Returns:
        a new Node from the given string.
        Throws:
        UnrepresentingArgumentException - if the given string does not represent a Node.
      • withAttribute

        public static <BN extends BaseNodeNode withAttribute​(BN attribute)
        Type Parameters:
        BN - is the type of the given attribute.
        Parameters:
        attribute -
        Returns:
        a new Node with the given attribute.
        Throws:
        ArgumentIsNullException - if the given attribute is null.
      • withAttribute

        public static <BN extends BaseNodeNode withAttribute​(BN... attributes)
        Type Parameters:
        BN - is the type of the given attributes.
        Parameters:
        attributes -
        Returns:
        a new Node with the given attributes.
      • withAttribute

        public static Node withAttribute​(boolean attribute)
        Parameters:
        attribute -
        Returns:
        a new Node with the given attribute.
      • withAttribute

        public static Node withAttribute​(boolean... attributes)
        Parameters:
        attributes -
        Returns:
        a new Node with the given attributes.
      • withAttribute

        public static Node withAttribute​(double attribute)
        Parameters:
        attribute -
        Returns:
        a new Node with the given attribute.
      • withAttribute

        public static Node withAttribute​(double... attributes)
        Parameters:
        attributes -
        Returns:
        a new Node with the given attributes.
      • withAttribute

        public static Node withAttribute​(long attribute)
        Parameters:
        attribute -
        Returns:
        a new Node with the given attribute.
      • withAttribute

        public static Node withAttribute​(long... attributes)
        Parameters:
        attributes -
        Returns:
        a new Node with the given attributes.
      • withAttribute

        public static Node withAttribute​(java.lang.String... attributes)
        Parameters:
        attributes -
        Returns:
        a new Node with the given attributes.
      • withAttributes

        public static <BN extends BaseNodeNode withAttributes​(java.lang.Iterable<BN> attributes)
        Type Parameters:
        BN - is the type of the given attributes.
        Parameters:
        attributes -
        Returns:
        a new Node with the given attributes.
      • withHeader

        public static Node withHeader​(boolean header)
        Parameters:
        header -
        Returns:
        a new Node with the given header.
      • withHeader

        public static Node withHeader​(double header)
        Parameters:
        header -
        Returns:
        a new Node with the given header.
      • withHeader

        public static Node withHeader​(long header)
        Parameters:
        header -
        Returns:
        a new Node with the given header.
      • withHeaderAndAttribute

        public static <BN extends BaseNodeNode withHeaderAndAttribute​(java.lang.String header,
                                                                        BN attribute)
        Type Parameters:
        BN - is the type of the given attributes.
        Parameters:
        header -
        attribute -
        Returns:
        a new Node with the given header and attribute.
        Throws:
        ArgumentIsNullException - if the given header is null.
        InvalidArgumentException - if the given header is blank.
        ArgumentIsNullException - if the given attribute is null.
      • withHeaderAndAttribute

        public static <BN extends BaseNodeNode withHeaderAndAttribute​(java.lang.String header,
                                                                        BN... attributes)
        Type Parameters:
        BN - is the type of the given attributes.
        Parameters:
        header -
        attributes -
        Returns:
        a new Node with the given header and attributes.
        Throws:
        ArgumentIsNullException - if the given header is null.
        InvalidArgumentException - if the given header is blank.
        ArgumentIsNullException - if one of the given attributes is null.
      • withHeaderAndAttribute

        public static Node withHeaderAndAttribute​(java.lang.String header,
                                                  boolean attribute)
        Parameters:
        header -
        attribute -
        Returns:
        a new Node with the given header and attribute.
        Throws:
        ArgumentIsNullException - if the given header is null.
        InvalidArgumentException - if the given header is blank.
      • withHeaderAndAttribute

        public static Node withHeaderAndAttribute​(java.lang.String header,
                                                  boolean... attributes)
        Parameters:
        header -
        attributes -
        Returns:
        a new Node with the given header and attributes.
        Throws:
        ArgumentIsNullException - if the given header is null.
        InvalidArgumentException - if the given header is blank.
      • withHeaderAndAttribute

        public static Node withHeaderAndAttribute​(java.lang.String header,
                                                  double attribute)
        Parameters:
        header -
        attribute -
        Returns:
        a new Node with the given header and attribute.
        Throws:
        ArgumentIsNullException - if the given header is null.
        InvalidArgumentException - if the given header is blank.
      • withHeaderAndAttribute

        public static Node withHeaderAndAttribute​(java.lang.String header,
                                                  double... attributes)
        Parameters:
        header -
        attributes -
        Returns:
        a new Node with the given header and attributes.
        Throws:
        ArgumentIsNullException - if the given header is null.
        InvalidArgumentException - if the given header is blank.
      • withHeaderAndAttribute

        public static Node withHeaderAndAttribute​(java.lang.String header,
                                                  long attribute)
        Parameters:
        header -
        attribute -
        Returns:
        a new Node with the given header and attribute.
        Throws:
        ArgumentIsNullException - if the given header is null.
        InvalidArgumentException - if the given header is blank.
      • withHeaderAndAttribute

        public static Node withHeaderAndAttribute​(java.lang.String header,
                                                  long... attributes)
        Parameters:
        header -
        attributes -
        Returns:
        a new Node with the given header and attributes.
        Throws:
        ArgumentIsNullException - if the given header is null.
        InvalidArgumentException - if the given header is blank.
      • withHeaderAndAttributes

        public static <BN extends BaseNodeNode withHeaderAndAttributes​(java.lang.String header,
                                                                         java.lang.Iterable<BN> attributes)
        Type Parameters:
        BN - is the type of the given attributes.
        Parameters:
        header -
        attributes -
        Returns:
        a new Node with the given attributes.
        Throws:
        ArgumentIsNullException - if the given header is null.
        InvalidArgumentException - if the given header is blank.
      • removeAttributes

        public void removeAttributes()
        Removes the attributes of the current Node.
        Specified by:
        removeAttributes in class BaseNode