Class NFEBasicNetwork
- java.lang.Object
-
- oracle.spatial.network.nfe.model.network.NFENetwork
-
- oracle.spatial.network.nfe.model.network.NFEBasicNetwork
-
public class NFEBasicNetwork extends NFENetwork
The default implementation ofNFENetwork
-
-
Constructor Summary
Constructors Constructor Description NFEBasicNetwork()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 classboolean
addNode(NFENode node)
Adds an existing node to the network.void
addNodes(java.util.Collection<NFENode> nodes)
Adds a collection of nodes to the networkboolean
changeLinkEndNode(long linkId, long endNodeId)
Changes the end node of the link identified by linkId to the node identified by endNodeIdboolean
changeLinkStartNode(long linkId, long startNodeId)
Changes the start node of the link identified by linkId to the node identified by startNodeIdboolean
contains(NFENetworkElement networkElement)
Tells whether the network contains the given networkElement or notNFELink
getLink(long linkId)
Gets the link identified by the given ID.java.util.Collection<NFELink>
getLinks()
Gets all the links contained in the networkNFENode
getNode(long nodeId)
Gets the node identified by the given ID.java.util.Collection<NFENode>
getNodes()
Gets all the nodes contained in the networkprotected void
notifyPropertyChanged(java.lang.Object modelObject, java.lang.String propertyName, java.lang.Object previousValue)
notifies to the current class about a property changed.NFELink
removeLink(long linkId)
Removes a link identified by the given ID from the networkvoid
removeModelListener(NFEModelListener listener)
Removes the given model listener from this classNFENode
removeNode(long nodeId)
Removes a node identified by the given ID from the network-
Methods inherited from class oracle.spatial.network.nfe.model.network.NFENetwork
addNodeLink, getEventDispatcher, getId, getMetadata, getName, removeNodeLink, setEventDispatcher, setId, setLinkNode, setMetadata, setName
-
-
-
-
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 classNFENetwork
- 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 classNFENetwork
- 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 classNFENetwork
- 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 classNFENetwork
- 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 classNFENetwork
- 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 classNFENetwork
- 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 classNFENetwork
- 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 classNFENetwork
- Parameters:
link
- an NFELink instancestartNodeId
- the ID of a node contained in the networkendNodeId
- 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 classNFENetwork
- 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 classNFENetwork
- 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 classNFENetwork
- 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 classNFENetwork
- 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 classNFENetwork
- Parameters:
linkId
- the ID of a link contained in the networkstartNodeId
- 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 classNFENetwork
- Parameters:
linkId
- linkId the ID of a link contained in the networkendNodeId
- 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 classNFENetwork
- Parameters:
modelObject
- The object owner of the changed propertypropertyName
- the changed property namepreviousValue
- 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 classNFENetwork
- 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 classNFENetwork
- Parameters:
listener
- an NFEModelListener instance
-
-