Class NFENode

    • Field Detail

      • PROP_HIERARCHY_LEVEL

        public static final java.lang.String PROP_HIERARCHY_LEVEL
        The hierarchy level property
        See Also:
        Constant Field Values
      • PROP_PARENT_NODE_ID

        public static final java.lang.String PROP_PARENT_NODE_ID
        The parent node id property
        See Also:
        Constant Field Values
    • Constructor Detail

      • NFENode

        public NFENode()
    • Method Detail

      • setHierarchyLevel

        public abstract void setHierarchyLevel​(int hierarchyLevel)
        Sets the node's hierarchy level
        Parameters:
        hierarchyLevel - the node's hierarchy level
      • getHierarchyLevel

        public abstract int getHierarchyLevel()
        Gets the node's hierarchy level
        Returns:
        the nodes hierarchy level
      • setParentNodeId

        public abstract void setParentNodeId​(long parentNodeId)
        Sets the node's parent node id
        Parameters:
        parentNodeId - the node's parent node id
      • getParentNodeId

        public abstract long getParentNodeId()
        Gets the node's parent node id if any
        Returns:
        the node's parent node id or -1 if it does not have a parent node
      • getLinks

        public abstract java.util.Collection<NFELink> getLinks()
        Gets all the links (in and out) connected to the node
        Returns:
        a collection containing all the links connected to the node as instances of NFELink
      • getInLinks

        public abstract java.util.Collection<NFELink> getInLinks()
        Gets all the in-links connected to the node
        Returns:
        a collection containing all the in-links connected to the node as instances of NFELink
      • getOutLinks

        public abstract java.util.Collection<NFELink> getOutLinks()
        Gets all the out-links connected to the node
        Returns:
        a collection containing all the out-links connected to the node as instances of NFELink
      • getNumberOfLinks

        public abstract int getNumberOfLinks()
        Gets the number of links (in and out) connected to the node
        Returns:
        the total number of connected links
      • getNumberOfInLinks

        public abstract int getNumberOfInLinks()
        Gets the number of in-links connected to the node
        Returns:
        the total number of connected in-links
      • getNumberOfOutLinks

        public abstract int getNumberOfOutLinks()
        Gets the number of out-links connected to the node
        Returns:
        the total number of connected out-links
      • getPartitionId

        public abstract long getPartitionId()
        Gets the node's partition id
        Returns:
        the node's partition id
      • setPartitionId

        public abstract void setPartitionId​(long partitionId)
        Sets the node's partition id
        Parameters:
        partitionId - the node's partition id
      • addLink

        protected abstract boolean addLink​(NFELink link,
                                           boolean addStartLink)
        Connects a link to the node. Whether the link is in or out is specified by the addStartLink parameter
        Parameters:
        link - an NFELink instance to be connected
        addStartLink - if true, the link is connected as in-link, otherwise, it is connected as out-link
        Returns:
      • removeLink

        protected abstract boolean removeLink​(NFELink link,
                                              boolean removeInLink)
        Removes the link from the node
        Parameters:
        link - an NFELink instance to be disconnected
        removeInLink - if true, the link is disconnected as in-link, otherwise it is disconnected as out-link.
        Returns:
        true if the link was removed. It returns false if the link was not previously connected to the node or if the link was not connected as specified by the removeInLink boolean parameter.
      • isNode

        public boolean isNode()
        Description copied from class: NFENetworkElement
        Tells whether the network element is a node or not
        Specified by:
        isNode in class NFENetworkElement
        Returns:
        true if the network element is a node
      • isLink

        public boolean isLink()
        Description copied from class: NFENetworkElement
        Tells whether the network element is a link or not
        Specified by:
        isLink in class NFENetworkElement
        Returns:
        true if the network element is a link
      • getKey

        public java.lang.String getKey()
        Description copied from class: NFENetworkElement
        Gets the network element's key. The key is a unique value to differentiate a network element among other network elements in the same network. There could be a node and a link with the same ID but cannot exist two network elements (node or links) with the same key
        Specified by:
        getKey in class NFENetworkElement
        Returns:
        the network element's key