Class NetworkNodeCollection

    • Method Detail

      • getNetwork

        public Network getNetwork()
        The Network the collection belongs to.
      • get

        public Node get​(String name)
        Performs a case sensitive lookup.
        Parameters:
        name - The name of the Node to find.
        Returns:
        The Node with the specified name; otherwise null.
      • get

        public Node get​(String name,
                        boolean throwIfNotFound)
        Performs a case sensitive lookup.
        Parameters:
        name - The name of the Node to find.
        throwIfNotFound - When true throws an exception if the name is not found.
        Returns:
        The Node with the specified name; otherwise null.
      • contains

        public boolean contains​(Object o)
        Determines whether a Node is in the collection. The operation is O(1).
        Specified by:
        contains in interface Collection<Node>
        Specified by:
        contains in interface List<Node>
        Overrides:
        contains in class AbstractCollection<Node>
        Parameters:
        o - The Node to locate in the collection. The value can be null.
        Returns:
        true if [o] is found in the collection; otherwise, false.
      • add

        public void add​(int index,
                        Node item)
        Inserts an element into the collection at the specified index.
        Specified by:
        add in interface List<Node>
        Overrides:
        add in class AbstractList<Node>
        Parameters:
        index - The zero based index at which to add the element.
        item - The item to insert. Cannot be null.
        Throws:
        NullPointerException - Raised when [item] is null.
        IllegalStateException - Raised if the node already belongs to a network.
        IllegalArgumentException - index is less than 0.-or-index is equal to or greater than the collection count.
      • indexOf

        public int indexOf​(Object o)
        Determines the index of a specific Node in the collection. This operation is O(1).
        Specified by:
        indexOf in interface List<Node>
        Overrides:
        indexOf in class AbstractList<Node>
        Parameters:
        o - The node. The value can be null.
        Returns:
        The index of the node or -1 if not found.
      • remove

        public boolean remove​(Node item)
        Removes the Node from the collection.
        Parameters:
        item - The Node to be removed from the collection.
        Returns:
        true if item was successfully removed from the collection; otherwise, false. This method also returns false if item is not found in the collection.
        Throws:
        NullPointerException - Raised if [item] is null.
      • remove

        public Node remove​(int index)
        Removes an element from the collection at the specified index, and any links that it has.
        Specified by:
        remove in interface List<Node>
        Overrides:
        remove in class AbstractList<Node>
        Parameters:
        index - The zero based index at which to remove the element.
        Throws:
        IllegalArgumentException - index is less than 0.-or-index is equal to or greater than the collection count.