Skip navigation links

Oracle® Spatial Java API Reference
11g Release 2 (11.2)
E11829-02


oracle.spatial.network.lod
Class NetworkExplorer

java.lang.Object
  extended by oracle.spatial.network.lod.NetworkExplorer


public class NetworkExplorer
extends java.lang.Object

This class provides methods to navigate a network. The network may contain dynamic network update information superimposed on the static network information.
The following summarizes the basic steps in network navigation starting from a node:
1. From the input node ID, get the network node object (LogicalNetNode) by calling

       networkExplorer.getNetNode(nodeId)
     

The returned LogicalNetNode object contains reference to its adjacent network links, which in turn contains references to the next nodes, and so on.
2. From the returned LogicalNetNode object, get the next node IDs or adjacent network link objects (LogicalNetLink), e.g.,

        netNode.getNextNodeIds(...), or
        netNode.getOutLinks(...)
     

3. From the returned LogicalNetLink objects, get the adjacent network node objects (LogicalNetNode), e.g.,

       netLink.getStartNode(), or 
       netLink.getEndNode(). 
     

4. At this point, you may be tempted to navigate further directly from these adjacent nodes. However, the network node objects returned from step 3 might be external node objects in the containing partition, thus, may not have all the references to their adjacent links. If you plan to navigate further from these adjacent nodes, you should always call the following method to ensure that you have the corresponding internal node object that contains all the references to its adjacent links.

       networkExplorer.getNetNode(adjacentNode.getId())
     

5. From the adjacent network node objects returned from step 4, you can continue navigating the network by repeating step 2 and 3.
6. Since the network node and link objects contain strong references to their adjacent objects, it is important to release any strong references to these objects as soon as you have finished investigating the corresponding part of the network, so that java VM can effectively garbage collect the network of objects that are interconnected to each other. If you have to keep some information from a network object for later, you should manage that information yourself without referencing the network object, or create a standalone object from the network object, and reference the standalone object instead. A standalone object does not contain any reference to other nodes or links.
To create a standalone object from a network object use:

       netLink.toStandAloneLink(), or
       netNode.toStandAloneNode().
     
Since:
11gR1

Field Summary
static int DIRECTION_BACKWARD
           
static int DIRECTION_BOTH
           
static int DIRECTION_FORWARD
           
static int MIN_LINK_LEVEL
           

 

Constructor Summary
NetworkExplorer(NetworkIO reader)
          Constructs a NetworkExplorer with empty network updates.

 

Method Summary
 LeveledNetworkCache getDynamicNetworkCache()
          Returns the dynamic network cache.
 HeavyPointOnNet[] getHeavyPointsOnNet(PointOnNet[] points, int[] userDataCategories)
           
 LogicalLink getLink(long linkId, int[] userDataCategories)
          Returns the standalone logical link.
 LogicalNetLink getNetLink(long linkId, int linkLevel, int partitionId, int[] userDataCategories)
          Returns the network link from the specified partition.
 LogicalNetNode getNetNode(long nodeId, int linkLevel, int[] userDataCategories)
          Returns the network node from the containing partition.
 NetworkIO getNetworkIO()
          Returns the network IO.
 java.util.HashMap<java.lang.Integer,NetworkUpdate> getNetworkUpdates()
          Returns the network updates for each link level.
 LogicalNode getNode(long nodeId, int[] userDataCategories)
          Returns the standalone node.
 int getNodePartitionId(long nodeId, int linkLevel)
          Returns the partition ID for the specified node.
 LogicalPartition getPartition(int partitionId, int linkLevel, int[] userDataCategories)
          Returns the partition.
 NetworkIO getReader()
          Deprecated. use getNetworkIO()
 void setNetworkUpdate(int linkLevel, NetworkUpdate networkUpdate)
          Sets the network update object and initialize the dynamic cache.
 void setNetworkUpdates(java.util.HashMap<java.lang.Integer,NetworkUpdate> networkUpdates)
          Sets the network update objects and re-initialize the dynamic cache.
 void setReader(NetworkIO reader)
          Sets the network reader and the maximum link level.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

DIRECTION_BOTH

public static final int DIRECTION_BOTH
See Also:
Constant Field Values

DIRECTION_FORWARD

public static final int DIRECTION_FORWARD
See Also:
Constant Field Values

DIRECTION_BACKWARD

public static final int DIRECTION_BACKWARD
See Also:
Constant Field Values

MIN_LINK_LEVEL

public static final int MIN_LINK_LEVEL
See Also:
Constant Field Values

Constructor Detail

NetworkExplorer

public NetworkExplorer(NetworkIO reader)
                throws LODNetworkException
Constructs a NetworkExplorer with empty network updates.
Parameters:
reader -
Throws:
LODNetworkException

Method Detail

setNetworkUpdates

public void setNetworkUpdates(java.util.HashMap<java.lang.Integer,NetworkUpdate> networkUpdates)
Sets the network update objects and re-initialize the dynamic cache. These network update objects will be super imposed to the static network information while the user navigates the network during network analysis.
Parameters:
networkUpdates - network update objects for different link levels

setNetworkUpdate

public void setNetworkUpdate(int linkLevel,
                             NetworkUpdate networkUpdate)
Sets the network update object and initialize the dynamic cache. These network update objects will be super imposed to the static network information while navigating the network during network analysis.
Parameters:
networkUpdate - network update object

getHeavyPointsOnNet

public HeavyPointOnNet[] getHeavyPointsOnNet(PointOnNet[] points,
                                             int[] userDataCategories)
                                      throws LODNetworkException
Throws:
LODNetworkException

getLink

public LogicalLink getLink(long linkId,
                           int[] userDataCategories)
                    throws LODNetworkException
Returns the standalone logical link. This method first searches for the link in the dynamic network update object. If not found, it reads the link through the NetworkIO object.
Parameters:
linkId - link ID
userDataCategories - If set to true, this method will return a SpatialLink.
Returns:
Throws:
LODNetworkException

getNode

public LogicalNode getNode(long nodeId,
                           int[] userDataCategories)
                    throws LODNetworkException
Returns the standalone node. This method first searches for the node in the dynamic network update object. If not found, it reads the node through the NetworkIO object.
Parameters:
nodeId - node ID
userDataCategories - If set to true, this method will return a SpatialNode.
Returns:
Throws:
LODNetworkException

getPartition

public LogicalPartition getPartition(int partitionId,
                                     int linkLevel,
                                     int[] userDataCategories)
                              throws LODNetworkException
Returns the partition. This method first searches for the partition in the dynamic network update object. If not found, it reads the partition through the NetworkIO object.
Parameters:
partitionId - partition ID
linkLevel - link level
userDataCategories -
Returns:
Throws:
LODNetworkException

getNodePartitionId

public int getNodePartitionId(long nodeId,
                              int linkLevel)
                       throws LODNetworkException
Returns the partition ID for the specified node.
Parameters:
nodeId - node ID
linkLevel - link level
Returns:
Throws:
LODNetworkException

getNetNode

public LogicalNetNode getNetNode(long nodeId,
                                 int linkLevel,
                                 int[] userDataCategories)
                          throws LODNetworkException
Returns the network node from the containing partition. The returned network node contains references to all its adjacent links.
Parameters:
nodeId - node ID
linkLevel - link level
userDataCategories -
Returns:
Throws:
LODNetworkException

getNetLink

public LogicalNetLink getNetLink(long linkId,
                                 int linkLevel,
                                 int partitionId,
                                 int[] userDataCategories)
                          throws LODNetworkException
Returns the network link from the specified partition.
Parameters:
linkId - link ID
linkLevel - link level
userDataCategories -
Returns:
Throws:
LODNetworkException

setReader

public void setReader(NetworkIO reader)
               throws LODNetworkException
Sets the network reader and the maximum link level.
Parameters:
reader - network reader
Throws:
LODNetworkException

getReader

public NetworkIO getReader()
Deprecated. use getNetworkIO()
Returns the network reader.
Returns:

getNetworkIO

public NetworkIO getNetworkIO()
Returns the network IO.
Returns:

getNetworkUpdates

public java.util.HashMap<java.lang.Integer,NetworkUpdate> getNetworkUpdates()
Returns the network updates for each link level.
Returns:

getDynamicNetworkCache

public LeveledNetworkCache getDynamicNetworkCache()
Returns the dynamic network cache.
Returns:

Skip navigation links

Oracle® Spatial Java API Reference
11g Release 2 (11.2)
E11829-02


Copyright © 2007, 2011, Oracle and/or its affiliates. All Rights Reserved.