public class NFEBasicNetwork extends NFENetwork
NFENetwork
Constructor and Description |
---|
NFEBasicNetwork() |
Modifier and Type | Method and Description |
---|---|
boolean |
addLink(NFELink link)
Adds an existing link to the network.
|
boolean |
addLink(NFELink link, long startNodeId, long endNodeId)
Adds an existing link to the network and sets the link's start and end nodes.
|
void |
addLinks(java.util.Collection<NFELink> links)
Adds all the links contained in the given collection.
|
void |
addModelListener(NFEModelListener listener)
Subscribes a model listener instance to this class
|
boolean |
addNode(NFENode node)
Adds an existing node to the network.
|
void |
addNodes(java.util.Collection<NFENode> nodes)
Adds a collection of nodes to the network
|
boolean |
changeLinkEndNode(long linkId, long endNodeId)
Changes the end node of the link identified by linkId to the node identified by endNodeId
|
boolean |
changeLinkStartNode(long linkId, long startNodeId)
Changes the start node of the link identified by linkId to the node identified by startNodeId
|
boolean |
contains(NFENetworkElement networkElement)
Tells whether the network contains the given networkElement or not
|
NFELink |
getLink(long linkId)
Gets the link identified by the given ID.
|
java.util.Collection<NFELink> |
getLinks()
Gets all the links contained in the network
|
NFENode |
getNode(long nodeId)
Gets the node identified by the given ID.
|
java.util.Collection<NFENode> |
getNodes()
Gets all the nodes contained in the network
|
NFELink |
removeLink(long linkId)
Removes a link identified by the given ID from the network
|
void |
removeModelListener(NFEModelListener listener)
Removes the given model listener from this class
|
NFENode |
removeNode(long nodeId)
Removes a node identified by the given ID from the network
|
getEventDispatcher, getId, getMetadata, getName, setEventDispatcher, setId, setMetadata, setName
public java.util.Collection<NFENode> getNodes()
NFENetwork
getNodes
in class NFENetwork
public java.util.Collection<NFELink> getLinks()
NFENetwork
getLinks
in class NFENetwork
public NFENode getNode(long nodeId)
NFENetwork
getNode
in class NFENetwork
nodeId
- a node IDpublic NFELink getLink(long linkId)
NFENetwork
getLink
in class NFENetwork
linkId
- a link IDpublic boolean contains(NFENetworkElement networkElement)
NFENetwork
contains
in class NFENetwork
networkElement
- a network element instance (a node or a link)public boolean addNode(NFENode node)
NFENetwork
addNode
in class NFENetwork
node
- an NFENode instancepublic void addNodes(java.util.Collection<NFENode> nodes)
NFENetwork
addNodes
in class NFENetwork
nodes
- a collection of nodespublic boolean addLink(NFELink link, long startNodeId, long endNodeId)
NFENetwork
addLink
in class NFENetwork
link
- an NFELink instancestartNodeId
- the ID of a node contained in the networkendNodeId
- the ID of a node contained in the networkpublic boolean addLink(NFELink link)
NFENetwork
addLink
in class NFENetwork
link
- an NFELink instance.public void addLinks(java.util.Collection<NFELink> links)
NFENetwork
addLinks
in class NFENetwork
links
- a collection of linkspublic NFENode removeNode(long nodeId)
NFENetwork
removeNode
in class NFENetwork
nodeId
- a node IDpublic NFELink removeLink(long linkId)
NFENetwork
removeLink
in class NFENetwork
linkId
- a link IDpublic boolean changeLinkStartNode(long linkId, long startNodeId)
NFENetwork
changeLinkStartNode
in class NFENetwork
linkId
- the ID of a link contained in the networkstartNodeId
- the ID of a node contained in the networkpublic boolean changeLinkEndNode(long linkId, long endNodeId)
NFENetwork
changeLinkEndNode
in class NFENetwork
linkId
- linkId the ID of a link contained in the networkendNodeId
- the ID of a node contained in the networkpublic void addModelListener(NFEModelListener listener)
NFENetwork
addModelListener
in class NFENetwork
listener
- an NFEModelListener instancepublic void removeModelListener(NFEModelListener listener)
NFENetwork
removeModelListener
in class NFENetwork
listener
- an NFEModelListener instance