Package oracle.spatial.network.lod
Class LeveledNetworkCache
- java.lang.Object
-
- oracle.spatial.network.lod.LeveledNetworkCache
-
public class LeveledNetworkCache extends java.lang.Object
An 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 int
MIN_LINK_LEVEL
-
Constructor Summary
Constructors Modifier Constructor Description protected
LeveledNetworkCache(CachingPolicy[] policies)
A LogicalNetworkCache must know the exact number of link levels and the caching policy for each link level when it is constructed.protected
LeveledNetworkCache(oracle.spatial.network.lod.NetworkCache[] networkCaches)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears network cache for all link levels.void
clear(int linkLevel)
Clears network cache for the specified link level.void
flushPartition(int partitionId, int linkLevel)
Removes the partition from the cache.protected int[]
getLinkPartitionIds(long linkId, int linkLevel)
protected int
getNodePartitionId(long nodeId, int linkLevel)
int
getNumberOfLinkLevels()
protected int
getNumberOfNodes(int linkLevel)
protected int
getNumberOfNodesInMemory()
Return the total number of nodes in memory for all link levels.int
getNumberOfNodesInMemory(int linkLevel)
Return the number of nodes in memory for the specified link level.int
getNumberOfPartitions(int linkLevel)
Returns the number of network partitions in the cache for the specified link level.protected LogicalPartition
getPartition(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 boolean
isNetworkPartitioned(int linkLevel)
protected boolean
isNetworkPartitionedSet(int linkLevel)
protected void
setIsNetworkPartitioned(boolean isNetworkPartitioned, int linkLevel)
protected void
setNetworkCache(int linkLevel, oracle.spatial.network.lod.NetworkCache networkCache)
protected void
setNodePartitionId(long nodeId, int partitionId, int linkLevel)
protected void
setNumberOfLinkLevels(int numLinkLevels)
protected void
setNumberOfLinks(int numberOfLinks, int linkLevel)
protected void
setNumberOfNodes(int numberOfNodes, int linkLevel)
void
setPartition(int partitionId, LogicalPartition partition, int linkLevel)
Adds or replaces a network partition in the cache.protected void
setPartitionIds(int[] partitionIds, int linkLevel)
java.lang.String
toString()
void
update(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 LODNetworkException
Adds 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 LODNetworkException
Updates the network cache.- Throws:
LODNetworkException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-