public abstract class NFENetwork
extends java.lang.Object
Constructor and Description |
---|
NFENetwork() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
addLink(NFELink link)
Adds an existing link to the network.
|
abstract boolean |
addLink(NFELink link, long startNodeId, long endNodeId)
Adds an existing link to the network and sets the link's start and end nodes.
|
abstract void |
addLinks(java.util.Collection<NFELink> links)
Adds all the links contained in the given collection.
|
abstract void |
addModelListener(NFEModelListener listener)
Subscribes a model listener instance to this class
|
abstract boolean |
addNode(NFENode node)
Adds an existing node to the network.
|
abstract void |
addNodes(java.util.Collection<NFENode> nodes)
Adds a collection of nodes to the network
|
abstract boolean |
changeLinkEndNode(long linkId, long endNodeId)
Changes the end node of the link identified by linkId to the node identified by endNodeId
|
abstract boolean |
changeLinkStartNode(long linkId, long startNodeId)
Changes the start node of the link identified by linkId to the node identified by startNodeId
|
abstract boolean |
contains(NFENetworkElement networkElement)
Tells whether the network contains the given networkElement or not
|
NFEEventDispatcher<NFEModelListener> |
getEventDispatcher()
Gets the event dispatcher currently used.
|
long |
getId()
Gets the ID of the network
|
abstract NFELink |
getLink(long linkId)
Gets the link identified by the given ID.
|
abstract java.util.Collection<NFELink> |
getLinks()
Gets all the links contained in the network
|
NFENetworkMetadata |
getMetadata()
Gets the network's metadata
|
java.lang.String |
getName()
Gets the name of the network
|
abstract NFENode |
getNode(long nodeId)
Gets the node identified by the given ID.
|
abstract java.util.Collection<NFENode> |
getNodes()
Gets all the nodes contained in the network
|
abstract NFELink |
removeLink(long linkId)
Removes a link identified by the given ID from the network
|
abstract void |
removeModelListener(NFEModelListener listener)
Removes the given model listener from this class
|
abstract NFENode |
removeNode(long nodeId)
Removes a node identified by the given ID from the network
|
void |
setEventDispatcher(NFEEventDispatcher<NFEModelListener> eventDispatcher)
Sets the event dispatcher that will be used to fire new events.
|
void |
setId(long id)
Sets the ID for the network
|
void |
setMetadata(NFENetworkMetadata networkMetadata)
Sets the metadata of the network
|
void |
setName(java.lang.String name)
Sets the name of the network
|
public void setId(long id)
id
- a network IDpublic long getId()
public void setName(java.lang.String name)
name
- the network's namepublic java.lang.String getName()
public void setMetadata(NFENetworkMetadata networkMetadata)
networkMetadata
- an instance of NFENetworkMetadatapublic NFENetworkMetadata getMetadata()
public void setEventDispatcher(NFEEventDispatcher<NFEModelListener> eventDispatcher)
eventDispatcher
- an NFEEventDispatcher instance.public NFEEventDispatcher<NFEModelListener> getEventDispatcher()
public abstract java.util.Collection<NFENode> getNodes()
public abstract java.util.Collection<NFELink> getLinks()
public abstract NFENode getNode(long nodeId)
nodeId
- a node IDpublic abstract NFELink getLink(long linkId)
linkId
- a link IDpublic abstract NFENode removeNode(long nodeId)
nodeId
- a node IDpublic abstract NFELink removeLink(long linkId)
linkId
- a link IDpublic abstract boolean contains(NFENetworkElement networkElement)
networkElement
- a network element instance (a node or a link)public abstract boolean addNode(NFENode node)
node
- an NFENode instancepublic abstract void addNodes(java.util.Collection<NFENode> nodes)
nodes
- a collection of nodespublic abstract boolean addLink(NFELink link)
link
- an NFELink instance.public abstract boolean addLink(NFELink link, long startNodeId, long endNodeId)
link
- an NFELink instancestartNodeId
- the ID of a node contained in the networkendNodeId
- the ID of a node contained in the networkpublic abstract void addLinks(java.util.Collection<NFELink> links)
links
- a collection of linkspublic abstract boolean changeLinkStartNode(long linkId, long startNodeId)
linkId
- the ID of a link contained in the networkstartNodeId
- the ID of a node contained in the networkpublic abstract boolean changeLinkEndNode(long linkId, long endNodeId)
linkId
- linkId the ID of a link contained in the networkendNodeId
- the ID of a node contained in the networkpublic abstract void addModelListener(NFEModelListener listener)
listener
- an NFEModelListener instancepublic abstract void removeModelListener(NFEModelListener listener)
listener
- an NFEModelListener instance