Package oracle.spatial.network.lod
Class LeveledNetworkCache
- java.lang.Object
-
- oracle.spatial.network.lod.LeveledNetworkCache
-
public class LeveledNetworkCache extends java.lang.ObjectAn instance of this class contains the cache for all link levels of a network.- Since:
- 11gR1
-
-
Field Summary
Fields Modifier and Type Field Description protected static intMIN_LINK_LEVEL
-
Constructor Summary
Constructors Modifier Constructor Description protectedLeveledNetworkCache(CachingPolicy[] policies)A LogicalNetworkCache must know the exact number of link levels and the caching policy for each link level when it is constructed.protectedLeveledNetworkCache(oracle.spatial.network.lod.NetworkCache[] networkCaches)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears network cache for all link levels.voidclear(int linkLevel)Clears network cache for the specified link level.voidflushPartition(int partitionId, int linkLevel)Removes the partition from the cache.protected int[]getLinkPartitionIds(long linkId, int linkLevel)protected intgetNodePartitionId(long nodeId, int linkLevel)intgetNumberOfLinkLevels()protected intgetNumberOfNodes(int linkLevel)protected intgetNumberOfNodesInMemory()Return the total number of nodes in memory for all link levels.intgetNumberOfNodesInMemory(int linkLevel)Return the number of nodes in memory for the specified link level.intgetNumberOfPartitions(int linkLevel)Returns the number of network partitions in the cache for the specified link level.protected LogicalPartitiongetPartition(int partitionId, int linkLevel)Retrieves the network partition from the cache.int[]getPartitionIds(int linkLevel)LongHashMap<LogicalPartition>getPartitions(int linkLevel)Returns all the network partitions in the cache for the specified link level.protected booleanisNetworkPartitioned(int linkLevel)protected booleanisNetworkPartitionedSet(int linkLevel)protected voidsetIsNetworkPartitioned(boolean isNetworkPartitioned, int linkLevel)protected voidsetNetworkCache(int linkLevel, oracle.spatial.network.lod.NetworkCache networkCache)protected voidsetNodePartitionId(long nodeId, int partitionId, int linkLevel)protected voidsetNumberOfLinkLevels(int numLinkLevels)protected voidsetNumberOfLinks(int numberOfLinks, int linkLevel)protected voidsetNumberOfNodes(int numberOfNodes, int linkLevel)voidsetPartition(int partitionId, LogicalPartition partition, int linkLevel)Adds or replaces a network partition in the cache.protected voidsetPartitionIds(int[] partitionIds, int linkLevel)java.lang.StringtoString()voidupdate(int linkLevel, NetworkUpdate networkUpdate)Updates the network cache.
-
-
-
Field Detail
-
MIN_LINK_LEVEL
protected static final int MIN_LINK_LEVEL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LeveledNetworkCache
protected LeveledNetworkCache(CachingPolicy[] policies) throws LODConfigException
A LogicalNetworkCache must know the exact number of link levels and the caching policy for each link level when it is constructed.- Parameters:
policies- caching policies- Throws:
LODConfigException
-
LeveledNetworkCache
protected LeveledNetworkCache(oracle.spatial.network.lod.NetworkCache[] networkCaches)
-
-
Method Detail
-
getNumberOfLinkLevels
public int getNumberOfLinkLevels()
-
getPartition
protected LogicalPartition getPartition(int partitionId, int linkLevel)
Retrieves the network partition from the cache.- Parameters:
partitionId- partition IDlinkLevel- link level- Returns:
- partition
-
getPartitions
public LongHashMap<LogicalPartition> getPartitions(int linkLevel)
Returns all the network partitions in the cache for the specified link level.- Parameters:
linkLevel- link level- Returns:
-
getNodePartitionId
protected int getNodePartitionId(long nodeId, int linkLevel)
-
getLinkPartitionIds
protected int[] getLinkPartitionIds(long linkId, int linkLevel)
-
getNumberOfNodes
protected int getNumberOfNodes(int linkLevel)
-
getNumberOfNodesInMemory
public int getNumberOfNodesInMemory(int linkLevel)
Return the number of nodes in memory for the specified link level.- Parameters:
linkLevel- link level- Returns:
-
getNumberOfNodesInMemory
protected int getNumberOfNodesInMemory()
Return the total number of nodes in memory for all link levels.- Returns:
-
getNumberOfPartitions
public int getNumberOfPartitions(int linkLevel)
Returns the number of network partitions in the cache for the specified link level.- Parameters:
linkLevel- link level- Returns:
-
getPartitionIds
public int[] getPartitionIds(int linkLevel)
-
isNetworkPartitioned
protected boolean isNetworkPartitioned(int linkLevel)
-
isNetworkPartitionedSet
protected boolean isNetworkPartitionedSet(int linkLevel)
-
setNetworkCache
protected void setNetworkCache(int linkLevel, oracle.spatial.network.lod.NetworkCache networkCache)
-
setNumberOfLinkLevels
protected void setNumberOfLinkLevels(int numLinkLevels)
-
setPartition
public void setPartition(int partitionId, LogicalPartition partition, int linkLevel) throws LODNetworkExceptionAdds or replaces a network partition in the cache.- Parameters:
partitionId-partition-- Throws:
LODNetworkException
-
setNodePartitionId
protected void setNodePartitionId(long nodeId, int partitionId, int linkLevel)
-
setNumberOfLinks
protected void setNumberOfLinks(int numberOfLinks, int linkLevel)
-
setNumberOfNodes
protected void setNumberOfNodes(int numberOfNodes, int linkLevel)
-
setPartitionIds
protected void setPartitionIds(int[] partitionIds, int linkLevel)
-
setIsNetworkPartitioned
protected void setIsNetworkPartitioned(boolean isNetworkPartitioned, int linkLevel)
-
flushPartition
public void flushPartition(int partitionId, int linkLevel)Removes the partition from the cache.- Parameters:
partitionId-linkLevel-
-
clear
public void clear(int linkLevel)
Clears network cache for the specified link level.- Parameters:
linkLevel- link level
-
clear
public void clear()
Clears network cache for all link levels.
-
update
public void update(int linkLevel, NetworkUpdate networkUpdate) throws LODNetworkExceptionUpdates the network cache.- Throws:
LODNetworkException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-