Class NFEBasicNetwork

    • Constructor Detail

      • NFEBasicNetwork

        public NFEBasicNetwork()
    • Method Detail

      • getNodes

        public java.util.Collection<NFENode> getNodes()
        Description copied from class: NFENetwork
        Gets all the nodes contained in the network
        Specified by:
        getNodes in class NFENetwork
        Returns:
        a collection of NFENode instances
      • getLinks

        public java.util.Collection<NFELink> getLinks()
        Description copied from class: NFENetwork
        Gets all the links contained in the network
        Specified by:
        getLinks in class NFENetwork
        Returns:
        a collection of NFELink instances
      • getNode

        public NFENode getNode​(long nodeId)
        Description copied from class: NFENetwork
        Gets the node identified by the given ID.
        Specified by:
        getNode in class NFENetwork
        Parameters:
        nodeId - a node ID
        Returns:
        an NFENode instance or null if it was not found
      • getLink

        public NFELink getLink​(long linkId)
        Description copied from class: NFENetwork
        Gets the link identified by the given ID.
        Specified by:
        getLink in class NFENetwork
        Parameters:
        linkId - a link ID
        Returns:
        an NFELink instance or null if it was not found
      • contains

        public boolean contains​(NFENetworkElement networkElement)
        Description copied from class: NFENetwork
        Tells whether the network contains the given networkElement or not
        Specified by:
        contains in class NFENetwork
        Parameters:
        networkElement - a network element instance (a node or a link)
        Returns:
        true if the network contains the element
      • addNode

        public boolean addNode​(NFENode node)
        Description copied from class: NFENetwork
        Adds an existing node to the network.
        Specified by:
        addNode in class NFENetwork
        Parameters:
        node - an NFENode instance
        Returns:
        true if the node was added
      • addNodes

        public void addNodes​(java.util.Collection<NFENode> nodes)
        Description copied from class: NFENetwork
        Adds a collection of nodes to the network
        Specified by:
        addNodes in class NFENetwork
        Parameters:
        nodes - a collection of nodes
      • addLink

        public boolean addLink​(NFELink link,
                               long startNodeId,
                               long endNodeId)
        Description copied from class: NFENetwork
        Adds an existing link to the network and sets the link's start and end nodes.
        Specified by:
        addLink in class NFENetwork
        Parameters:
        link - an NFELink instance
        startNodeId - the ID of a node contained in the network
        endNodeId - the ID of a node contained in the network
        Returns:
        true if the link was added
      • addLink

        public boolean addLink​(NFELink link)
        Description copied from class: NFENetwork
        Adds an existing link to the network. The link's start and end nodes must be contained in the network.
        Specified by:
        addLink in class NFENetwork
        Parameters:
        link - an NFELink instance.
        Returns:
        true if the link was added
      • addLinks

        public void addLinks​(java.util.Collection<NFELink> links)
        Description copied from class: NFENetwork
        Adds all the links contained in the given collection. All the links must have a start and end node already contained in the network.
        Specified by:
        addLinks in class NFENetwork
        Parameters:
        links - a collection of links
      • removeNode

        public NFENode removeNode​(long nodeId)
        Description copied from class: NFENetwork
        Removes a node identified by the given ID from the network
        Specified by:
        removeNode in class NFENetwork
        Parameters:
        nodeId - a node ID
        Returns:
        the removed NFENode instance or null if it was not found or could not be removed
      • removeLink

        public NFELink removeLink​(long linkId)
        Description copied from class: NFENetwork
        Removes a link identified by the given ID from the network
        Specified by:
        removeLink in class NFENetwork
        Parameters:
        linkId - a link ID
        Returns:
        the removed NFELink instance or null if it was not found or could not be removed
      • changeLinkStartNode

        public boolean changeLinkStartNode​(long linkId,
                                           long startNodeId)
        Description copied from class: NFENetwork
        Changes the start node of the link identified by linkId to the node identified by startNodeId
        Specified by:
        changeLinkStartNode in class NFENetwork
        Parameters:
        linkId - the ID of a link contained in the network
        startNodeId - the ID of a node contained in the network
        Returns:
        true if the node was changed
      • changeLinkEndNode

        public boolean changeLinkEndNode​(long linkId,
                                         long endNodeId)
        Description copied from class: NFENetwork
        Changes the end node of the link identified by linkId to the node identified by endNodeId
        Specified by:
        changeLinkEndNode in class NFENetwork
        Parameters:
        linkId - linkId the ID of a link contained in the network
        endNodeId - the ID of a node contained in the network
        Returns:
        true if the node was changed
      • notifyPropertyChanged

        protected void notifyPropertyChanged​(java.lang.Object modelObject,
                                             java.lang.String propertyName,
                                             java.lang.Object previousValue)
        Description copied from class: NFENetwork
        notifies to the current class about a property changed. The changed property may belong to the current object or to a contained object.
        Specified by:
        notifyPropertyChanged in class NFENetwork
        Parameters:
        modelObject - The object owner of the changed property
        propertyName - the changed property name
        previousValue - the previous value of the changed property
      • addModelListener

        public void addModelListener​(NFEModelListener listener)
        Description copied from class: NFENetwork
        Subscribes a model listener instance to this class
        Specified by:
        addModelListener in class NFENetwork
        Parameters:
        listener - an NFEModelListener instance
      • removeModelListener

        public void removeModelListener​(NFEModelListener listener)
        Description copied from class: NFENetwork
        Removes the given model listener from this class
        Specified by:
        removeModelListener in class NFENetwork
        Parameters:
        listener - an NFEModelListener instance