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 booleanaddLink(NFELink link)Adds an existing link to the network.booleanaddLink(NFELink link, long startNodeId, long endNodeId)Adds an existing link to the network and sets the link's start and end nodes.voidaddLinks(java.util.Collection<NFELink> links)Adds all the links contained in the given collection.voidaddModelListener(NFEModelListener listener)Subscribes a model listener instance to this classbooleanaddNode(NFENode node)Adds an existing node to the network.voidaddNodes(java.util.Collection<NFENode> nodes)Adds a collection of nodes to the networkbooleanchangeLinkEndNode(long linkId, long endNodeId)Changes the end node of the link identified by linkId to the node identified by endNodeIdbooleanchangeLinkStartNode(long linkId, long startNodeId)Changes the start node of the link identified by linkId to the node identified by startNodeIdbooleancontains(NFENetworkElement networkElement)Tells whether the network contains the given networkElement or notNFELinkgetLink(long linkId)Gets the link identified by the given ID.java.util.Collection<NFELink>getLinks()Gets all the links contained in the networkNFENodegetNode(long nodeId)Gets the node identified by the given ID.java.util.Collection<NFENode>getNodes()Gets all the nodes contained in the networkprotected voidnotifyPropertyChanged(java.lang.Object modelObject, java.lang.String propertyName, java.lang.Object previousValue)notifies to the current class about a property changed.NFELinkremoveLink(long linkId)Removes a link identified by the given ID from the networkvoidremoveModelListener(NFEModelListener listener)Removes the given model listener from this classNFENoderemoveNode(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:NFENetworkGets all the nodes contained in the network- Specified by:
getNodesin classNFENetwork- Returns:
- a collection of NFENode instances
-
getLinks
public java.util.Collection<NFELink> getLinks()
Description copied from class:NFENetworkGets all the links contained in the network- Specified by:
getLinksin classNFENetwork- Returns:
- a collection of NFELink instances
-
getNode
public NFENode getNode(long nodeId)
Description copied from class:NFENetworkGets the node identified by the given ID.- Specified by:
getNodein 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:NFENetworkGets the link identified by the given ID.- Specified by:
getLinkin 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:NFENetworkTells whether the network contains the given networkElement or not- Specified by:
containsin 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:NFENetworkAdds an existing node to the network.- Specified by:
addNodein 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:NFENetworkAdds a collection of nodes to the network- Specified by:
addNodesin classNFENetwork- Parameters:
nodes- a collection of nodes
-
addLink
public boolean addLink(NFELink link, long startNodeId, long endNodeId)
Description copied from class:NFENetworkAdds an existing link to the network and sets the link's start and end nodes.- Specified by:
addLinkin 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:NFENetworkAdds an existing link to the network. The link's start and end nodes must be contained in the network.- Specified by:
addLinkin 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:NFENetworkAdds 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:
addLinksin classNFENetwork- Parameters:
links- a collection of links
-
removeNode
public NFENode removeNode(long nodeId)
Description copied from class:NFENetworkRemoves a node identified by the given ID from the network- Specified by:
removeNodein 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:NFENetworkRemoves a link identified by the given ID from the network- Specified by:
removeLinkin 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:NFENetworkChanges the start node of the link identified by linkId to the node identified by startNodeId- Specified by:
changeLinkStartNodein 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:NFENetworkChanges the end node of the link identified by linkId to the node identified by endNodeId- Specified by:
changeLinkEndNodein 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:NFENetworknotifies to the current class about a property changed. The changed property may belong to the current object or to a contained object.- Specified by:
notifyPropertyChangedin 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:NFENetworkSubscribes a model listener instance to this class- Specified by:
addModelListenerin classNFENetwork- Parameters:
listener- an NFEModelListener instance
-
removeModelListener
public void removeModelListener(NFEModelListener listener)
Description copied from class:NFENetworkRemoves the given model listener from this class- Specified by:
removeModelListenerin classNFENetwork- Parameters:
listener- an NFEModelListener instance
-
-