Class NFENetwork
- java.lang.Object
-
- oracle.spatial.network.nfe.model.network.NFENetwork
-
- Direct Known Subclasses:
NFEBasicNetwork
public abstract class NFENetwork extends java.lang.ObjectMemory representation of an SDO network. Use NFEModelObjectFactory.createNetwork() to get an instance of this class. An instance of this class is usually created and populated automatically when an NFEModel is created.
-
-
Constructor Summary
Constructors Constructor Description NFENetwork()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanaddLink(NFELink link)Adds an existing link to the network.abstract booleanaddLink(NFELink link, long startNodeId, long endNodeId)Adds an existing link to the network and sets the link's start and end nodes.abstract voidaddLinks(java.util.Collection<NFELink> links)Adds all the links contained in the given collection.abstract voidaddModelListener(NFEModelListener listener)Subscribes a model listener instance to this classabstract booleanaddNode(NFENode node)Adds an existing node to the network.protected booleanaddNodeLink(NFENode node, NFELink link, boolean addInLink)Adds a connected (in or out) link to the given node.abstract voidaddNodes(java.util.Collection<NFENode> nodes)Adds a collection of nodes to the networkabstract booleanchangeLinkEndNode(long linkId, long endNodeId)Changes the end node of the link identified by linkId to the node identified by endNodeIdabstract booleanchangeLinkStartNode(long linkId, long startNodeId)Changes the start node of the link identified by linkId to the node identified by startNodeIdabstract booleancontains(NFENetworkElement networkElement)Tells whether the network contains the given networkElement or notNFEEventDispatcher<NFEModelListener>getEventDispatcher()Gets the event dispatcher currently used.longgetId()Gets the ID of the networkabstract NFELinkgetLink(long linkId)Gets the link identified by the given ID.abstract java.util.Collection<NFELink>getLinks()Gets all the links contained in the networkNFENetworkMetadatagetMetadata()Gets the network's metadatajava.lang.StringgetName()Gets the name of the networkabstract NFENodegetNode(long nodeId)Gets the node identified by the given ID.abstract java.util.Collection<NFENode>getNodes()Gets all the nodes contained in the networkprotected abstract voidnotifyPropertyChanged(java.lang.Object modelObject, java.lang.String propertyName, java.lang.Object previousValue)notifies to the current class about a property changed.abstract NFELinkremoveLink(long linkId)Removes a link identified by the given ID from the networkabstract voidremoveModelListener(NFEModelListener listener)Removes the given model listener from this classabstract NFENoderemoveNode(long nodeId)Removes a node identified by the given ID from the networkprotected booleanremoveNodeLink(NFENode node, NFELink link, boolean removeInLink)Removes a connected link from a nodevoidsetEventDispatcher(NFEEventDispatcher<NFEModelListener> eventDispatcher)Sets the event dispatcher that will be used to fire new events.voidsetId(long id)Sets the ID for the networkprotected voidsetLinkNode(NFELink link, NFENode node, boolean setStartNode)Sets a link's start or end node.voidsetMetadata(NFENetworkMetadata networkMetadata)Sets the metadata of the networkvoidsetName(java.lang.String name)Sets the name of the network
-
-
-
Method Detail
-
setId
public void setId(long id)
Sets the ID for the network- Parameters:
id- a network ID
-
getId
public long getId()
Gets the ID of the network- Returns:
- a network ID
-
setName
public void setName(java.lang.String name)
Sets the name of the network- Parameters:
name- the network's name
-
getName
public java.lang.String getName()
Gets the name of the network- Returns:
- the network's name
-
setMetadata
public void setMetadata(NFENetworkMetadata networkMetadata)
Sets the metadata of the network- Parameters:
networkMetadata- an instance of NFENetworkMetadata
-
getMetadata
public NFENetworkMetadata getMetadata()
Gets the network's metadata- Returns:
- an instance of NFENetworkMetadata
-
setEventDispatcher
public void setEventDispatcher(NFEEventDispatcher<NFEModelListener> eventDispatcher)
Sets the event dispatcher that will be used to fire new events. If it is set to null, no events will be fired.- Parameters:
eventDispatcher- an NFEEventDispatcher instance.
-
getEventDispatcher
public NFEEventDispatcher<NFEModelListener> getEventDispatcher()
Gets the event dispatcher currently used.- Returns:
- an NFEEventDispatcher instance.
-
getNodes
public abstract java.util.Collection<NFENode> getNodes()
Gets all the nodes contained in the network- Returns:
- a collection of NFENode instances
-
getLinks
public abstract java.util.Collection<NFELink> getLinks()
Gets all the links contained in the network- Returns:
- a collection of NFELink instances
-
getNode
public abstract NFENode getNode(long nodeId)
Gets the node identified by the given ID.- Parameters:
nodeId- a node ID- Returns:
- an NFENode instance or null if it was not found
-
getLink
public abstract NFELink getLink(long linkId)
Gets the link identified by the given ID.- Parameters:
linkId- a link ID- Returns:
- an NFELink instance or null if it was not found
-
removeNode
public abstract NFENode removeNode(long nodeId)
Removes a node identified by the given ID from the network- Parameters:
nodeId- a node ID- Returns:
- the removed NFENode instance or null if it was not found or could not be removed
-
removeLink
public abstract NFELink removeLink(long linkId)
Removes a link identified by the given ID from the network- Parameters:
linkId- a link ID- Returns:
- the removed NFELink instance or null if it was not found or could not be removed
-
contains
public abstract boolean contains(NFENetworkElement networkElement)
Tells whether the network contains the given networkElement or not- Parameters:
networkElement- a network element instance (a node or a link)- Returns:
- true if the network contains the element
-
addNode
public abstract boolean addNode(NFENode node)
Adds an existing node to the network.- Parameters:
node- an NFENode instance- Returns:
- true if the node was added
-
addNodes
public abstract void addNodes(java.util.Collection<NFENode> nodes)
Adds a collection of nodes to the network- Parameters:
nodes- a collection of nodes
-
addLink
public abstract boolean addLink(NFELink link)
Adds an existing link to the network. The link's start and end nodes must be contained in the network.- Parameters:
link- an NFELink instance.- Returns:
- true if the link was added
-
addLink
public 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.- 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
-
addLinks
public abstract void addLinks(java.util.Collection<NFELink> links)
Adds all the links contained in the given collection. All the links must have a start and end node already contained in the network.- Parameters:
links- a collection of links
-
changeLinkStartNode
public abstract boolean changeLinkStartNode(long linkId, long startNodeId)Changes the start node of the link identified by linkId to the node identified by startNodeId- 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 abstract boolean changeLinkEndNode(long linkId, long endNodeId)Changes the end node of the link identified by linkId to the node identified by endNodeId- 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 abstract void notifyPropertyChanged(java.lang.Object modelObject, java.lang.String propertyName, java.lang.Object previousValue)notifies to the current class about a property changed. The changed property may belong to the current object or to a contained object.- Parameters:
modelObject- The object owner of the changed propertypropertyName- the changed property namepreviousValue- the previous value of the changed property
-
setLinkNode
protected void setLinkNode(NFELink link, NFENode node, boolean setStartNode)
Sets a link's start or end node.- Parameters:
link- an NFELink instancenode- an NFENode instancesetStartNode- whether the node is start node (true) or end node (false)
-
addNodeLink
protected boolean addNodeLink(NFENode node, NFELink link, boolean addInLink)
Adds a connected (in or out) link to the given node.- Parameters:
node- an NFENode instancelink- an NFELink instanceaddInLink- whether the link will be in link (true) or out link (false)- Returns:
-
removeNodeLink
protected boolean removeNodeLink(NFENode node, NFELink link, boolean removeInLink)
Removes a connected link from a node- Parameters:
node- an NFENode instancelink- an NFELink instanceremoveInLink- whether the link to remove is in link (true) or out link (false)- Returns:
-
addModelListener
public abstract void addModelListener(NFEModelListener listener)
Subscribes a model listener instance to this class- Parameters:
listener- an NFEModelListener instance
-
removeModelListener
public abstract void removeModelListener(NFEModelListener listener)
Removes the given model listener from this class- Parameters:
listener- an NFEModelListener instance
-
-