Package oracle.spatial.network.lod
Class LogicalPartitionImpl
- java.lang.Object
-
- oracle.spatial.network.lod.LogicalPartitionImpl
-
- All Implemented Interfaces:
java.lang.Cloneable
,LogicalBasicNetwork
,LogicalPartition
,LogicalSubNetwork
public class LogicalPartitionImpl extends java.lang.Object implements LogicalPartition
Default implementation of LogicalPartition.- Since:
- 11gR1
-
-
Constructor Summary
Constructors Modifier Constructor Description LogicalPartitionImpl(java.lang.String networkName, int partitionId, int linkLevel)
protected
LogicalPartitionImpl(java.lang.String networkName, int partitionId, int linkLevel, int numInternalNodes, int numExternalNodes, int numInternalLinks, int numBoundaryLinks)
protected
LogicalPartitionImpl(LogicalPartitionImpl partition)
protected
LogicalPartitionImpl(oracle.spatial.network.lod.LogicalSubNetworkImpl network, int partitionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addFeatureLayer(int featureLayerId, FeatureLayer featureLayer)
Adds the feature layer.void
addLink(LogicalNetLink link)
Adds a logical link to the network.void
addNode(LogicalNetNode node)
Adds a logical node to the network.void
addNode(LogicalNetNode node, boolean isInternal)
Adds a logical node to the sub-network.void
addNode(LogicalNetNode node, int partitionId)
Adds a node to the network partition.void
addUserDataCategories(int[] userDataCategories)
void
addUserDataCategory(int userDataCategory)
Adds the user data category that have been loaded to the network.java.lang.Object
clone()
Supports cloneablelong[]
getBoundaryLinkIds()
Returns all the boundary link IDs in the sub-network.long[]
getExternalNodeIds()
Returns all the external node IDs in the sub-network.FeatureData
getFeatureData()
Returns the feature data associated to this network.long[]
getIncomingLinkIds()
Returns all the incoming link IDs in the sub-network.long[]
getInternalBoundaryNodeIds()
Returns all the internal node IDs in the sub-network without a link to any external nodes.long[]
getInternalLinkIds()
Returns all the internal link IDs in the sub-network.long[]
getInternalNodeIds()
Returns all the internal node IDs in the sub-network.protected LongHashSet
getInternalNodes()
long[]
getInternalNonBoundaryNodeIds()
Returns all the internal node IDs in the sub-network without a link to any external nodes.LogicalNetLink
getLink(long linkId)
Returns the logical link object for the specified link id.long[]
getLinkIds()
Returns all the link ids in the network.int
getLinkLevel()
Returns the link level of the network.int[]
getLinkPartitionIds(long linkId)
Returns the ID of the partitions that the start and end nodes of the input link belongs to.LogicalNetLink[]
getLinks()
Returns all the links in the network.java.lang.String
getName()
Returns the internal network name, for example, the network name stored in network metadata table.LogicalNetNode
getNode(long nodeId)
Returns the logical node object for the specified node id.long[]
getNodeIds()
Returns all the node ids in the network.int
getNodePartitionId(long nodeId)
Returns the ID of the partition that the input node belongs to.LogicalNetNode[]
getNodes()
Returns all the nodes in the network.int
getNumberOfBoundaryLinks()
Returns the number of boundary links in the sub-network, which includes both incoming links and outgoing links.int
getNumberOfExternalNodes()
Returns the number of external nodes in the sub-network.int
getNumberOfIncomingLinks()
Returns the number of incoming links to the sub-network.int
getNumberOfInternalLinks()
Returns the number of internal links in the sub-network.int
getNumberOfInternalNodes()
Returns the number of internal nodes in the sub-network.int
getNumberOfLinks()
Returns the total number of links in the network.int
getNumberOfNodes()
Returns the total number of nodes in the network.int
getNumberOfOutgoingLinks()
Returns the number of outgoing links from the sub-network.long[]
getOutgoingLinkIds()
Returns all the outgoing link IDs in the sub-network.int
getPartitionId()
Returns the partition ID of this partition.int[]
getUserDataCategories()
Returns the user data categories loaded in the network.boolean
isFeatureLayerLoaded(int featureLayerId)
Returns whether the specified user data category is loaded.boolean
isIncomingLink(long linkId)
Checks whether the input link is an incoming link or not.boolean
isInternalLink(long linkId)
Checks whether the input link is an internal link or not.boolean
isInternalNode(long nodeId)
Checks whether the input node is an internal node or not.boolean
isOutgoingLink(long linkId)
Checks whether the input link is an outgoing link or not.boolean
isUserDataCategoryLoaded(int category)
Returns whether the specified user data category is loaded.boolean
isUserDataLoaded()
Deprecated.void
removeLink(long linkId)
Removes a link from the network.void
removeNode(long nodeId)
Removes a node from the network.void
setFeatureData(FeatureData featureData)
Sets the feature data associated to this network.void
setIsUserDataLoaded(boolean isUserDataLoaded)
Deprecated.void
setNodePartitionId(long nodeId, int partitionId)
Sets the partition the node belongs to.void
update(PartitionUpdate pu)
Updates this network partition with the input partition update information.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface oracle.spatial.network.lod.LogicalBasicNetwork
addFeatureLayer, addLink, addNode, addUserDataCategory, getFeatureData, getLink, getLinkIds, getLinkLevel, getLinks, getName, getNode, getNodeIds, getNodes, getNumberOfLinks, getNumberOfNodes, getUserDataCategories, isFeatureLayerLoaded, isUserDataCategoryLoaded, isUserDataLoaded, removeLink, setFeatureData, setIsUserDataLoaded
-
Methods inherited from interface oracle.spatial.network.lod.LogicalSubNetwork
addNode, getBoundaryLinkIds, getExternalNodeIds, getIncomingLinkIds, getInternalBoundaryNodeIds, getInternalLinkIds, getInternalNodeIds, getInternalNonBoundaryNodeIds, getNumberOfBoundaryLinks, getNumberOfExternalNodes, getNumberOfIncomingLinks, getNumberOfInternalLinks, getNumberOfInternalNodes, getNumberOfOutgoingLinks, getOutgoingLinkIds, isIncomingLink, isInternalLink, isInternalNode, isOutgoingLink
-
-
-
-
Constructor Detail
-
LogicalPartitionImpl
public LogicalPartitionImpl(java.lang.String networkName, int partitionId, int linkLevel)
-
LogicalPartitionImpl
protected LogicalPartitionImpl(java.lang.String networkName, int partitionId, int linkLevel, int numInternalNodes, int numExternalNodes, int numInternalLinks, int numBoundaryLinks)
-
LogicalPartitionImpl
protected LogicalPartitionImpl(oracle.spatial.network.lod.LogicalSubNetworkImpl network, int partitionId)
-
LogicalPartitionImpl
protected LogicalPartitionImpl(LogicalPartitionImpl partition)
-
-
Method Detail
-
getPartitionId
public int getPartitionId()
Description copied from interface:LogicalPartition
Returns the partition ID of this partition.- Specified by:
getPartitionId
in interfaceLogicalPartition
- Returns:
- partition ID of this partition
-
addNode
public void addNode(LogicalNetNode node, int partitionId)
Description copied from interface:LogicalPartition
Adds a node to the network partition. The input partition ID can be the same as the partition ID of this network partition, in which case, the node to be added is an internal node; otherwise, the node is an external node, belong to a neighboring partition.- Specified by:
addNode
in interfaceLogicalPartition
- Parameters:
node
- logical nodepartitionId
- ID of the partition that the node belongs to
-
getNodePartitionId
public int getNodePartitionId(long nodeId) throws NodeNotFoundException
Description copied from interface:LogicalPartition
Returns the ID of the partition that the input node belongs to.- Specified by:
getNodePartitionId
in interfaceLogicalPartition
- Parameters:
nodeId
- node ID- Returns:
- partition ID
- Throws:
NodeNotFoundException
-
setNodePartitionId
public void setNodePartitionId(long nodeId, int partitionId)
Description copied from interface:LogicalPartition
Sets the partition the node belongs to.- Specified by:
setNodePartitionId
in interfaceLogicalPartition
- Parameters:
nodeId
- node IDpartitionId
- partition ID
-
getLinkPartitionIds
public int[] getLinkPartitionIds(long linkId) throws LinkNotFoundException
Description copied from interface:LogicalPartition
Returns the ID of the partitions that the start and end nodes of the input link belongs to.- Specified by:
getLinkPartitionIds
in interfaceLogicalPartition
- Parameters:
linkId
- link ID- Returns:
- partition IDs
- Throws:
LinkNotFoundException
-
removeNode
public void removeNode(long nodeId)
Description copied from interface:LogicalBasicNetwork
Removes a node from the network.- Specified by:
removeNode
in interfaceLogicalBasicNetwork
- Parameters:
nodeId
- ID of the node to be removed
-
update
public void update(PartitionUpdate pu) throws LODNetworkException
Description copied from interface:LogicalPartition
Updates this network partition with the input partition update information.- Specified by:
update
in interfaceLogicalPartition
- Parameters:
pu
- partition update information- Throws:
LODNetworkException
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Description copied from interface:LogicalBasicNetwork
Supports cloneable- Specified by:
clone
in interfaceLogicalBasicNetwork
- Returns:
- cloned object
- Throws:
java.lang.CloneNotSupportedException
-
getNumberOfInternalNodes
public int getNumberOfInternalNodes()
Description copied from interface:LogicalSubNetwork
Returns the number of internal nodes in the sub-network.- Specified by:
getNumberOfInternalNodes
in interfaceLogicalSubNetwork
- Returns:
- number of internal nodes
-
getNumberOfExternalNodes
public int getNumberOfExternalNodes()
Description copied from interface:LogicalSubNetwork
Returns the number of external nodes in the sub-network.- Specified by:
getNumberOfExternalNodes
in interfaceLogicalSubNetwork
- Returns:
- number of external nodes
-
getInternalNodeIds
public long[] getInternalNodeIds()
Description copied from interface:LogicalSubNetwork
Returns all the internal node IDs in the sub-network.- Specified by:
getInternalNodeIds
in interfaceLogicalSubNetwork
- Returns:
- array of internal node IDs
-
getInternalBoundaryNodeIds
public long[] getInternalBoundaryNodeIds()
Description copied from interface:LogicalSubNetwork
Returns all the internal node IDs in the sub-network without a link to any external nodes.- Specified by:
getInternalBoundaryNodeIds
in interfaceLogicalSubNetwork
- Returns:
- array of internal boundary node IDs
-
getInternalNonBoundaryNodeIds
public long[] getInternalNonBoundaryNodeIds()
Description copied from interface:LogicalSubNetwork
Returns all the internal node IDs in the sub-network without a link to any external nodes.- Specified by:
getInternalNonBoundaryNodeIds
in interfaceLogicalSubNetwork
- Returns:
- array of internal non-boundary node IDs
-
getExternalNodeIds
public long[] getExternalNodeIds()
Description copied from interface:LogicalSubNetwork
Returns all the external node IDs in the sub-network.- Specified by:
getExternalNodeIds
in interfaceLogicalSubNetwork
- Returns:
- array of external node IDs
-
isInternalNode
public boolean isInternalNode(long nodeId)
Description copied from interface:LogicalSubNetwork
Checks whether the input node is an internal node or not.- Specified by:
isInternalNode
in interfaceLogicalSubNetwork
- Parameters:
nodeId
- node id- Returns:
- true, if the input node is an internal node; false, otherwise.
-
isInternalLink
public boolean isInternalLink(long linkId)
Description copied from interface:LogicalSubNetwork
Checks whether the input link is an internal link or not.- Specified by:
isInternalLink
in interfaceLogicalSubNetwork
- Parameters:
linkId
- link ID- Returns:
- true, if the input link is an internal link; false, otherwise.
-
isIncomingLink
public boolean isIncomingLink(long linkId)
Description copied from interface:LogicalSubNetwork
Checks whether the input link is an incoming link or not.- Specified by:
isIncomingLink
in interfaceLogicalSubNetwork
- Parameters:
linkId
- link ID- Returns:
- true, if the input link is an incoming link; false, otherwise.
-
isOutgoingLink
public boolean isOutgoingLink(long linkId)
Description copied from interface:LogicalSubNetwork
Checks whether the input link is an outgoing link or not.- Specified by:
isOutgoingLink
in interfaceLogicalSubNetwork
- Parameters:
linkId
- link ID- Returns:
- true, if the input link is an outgoing link; false, otherwise.
-
getInternalLinkIds
public long[] getInternalLinkIds()
Description copied from interface:LogicalSubNetwork
Returns all the internal link IDs in the sub-network.- Specified by:
getInternalLinkIds
in interfaceLogicalSubNetwork
- Returns:
- array of internal link IDs.
-
getBoundaryLinkIds
public long[] getBoundaryLinkIds()
Description copied from interface:LogicalSubNetwork
Returns all the boundary link IDs in the sub-network.- Specified by:
getBoundaryLinkIds
in interfaceLogicalSubNetwork
- Returns:
- array of boundary link IDs.
-
getIncomingLinkIds
public long[] getIncomingLinkIds()
Description copied from interface:LogicalSubNetwork
Returns all the incoming link IDs in the sub-network.- Specified by:
getIncomingLinkIds
in interfaceLogicalSubNetwork
- Returns:
- array of incoming link IDs.
-
getOutgoingLinkIds
public long[] getOutgoingLinkIds()
Description copied from interface:LogicalSubNetwork
Returns all the outgoing link IDs in the sub-network.- Specified by:
getOutgoingLinkIds
in interfaceLogicalSubNetwork
- Returns:
- array of outgoing link IDs.
-
getNumberOfInternalLinks
public int getNumberOfInternalLinks()
Description copied from interface:LogicalSubNetwork
Returns the number of internal links in the sub-network.- Specified by:
getNumberOfInternalLinks
in interfaceLogicalSubNetwork
- Returns:
- number of internal links
-
getNumberOfBoundaryLinks
public int getNumberOfBoundaryLinks()
Description copied from interface:LogicalSubNetwork
Returns the number of boundary links in the sub-network, which includes both incoming links and outgoing links.- Specified by:
getNumberOfBoundaryLinks
in interfaceLogicalSubNetwork
- Returns:
- number of boundary links
-
getNumberOfIncomingLinks
public int getNumberOfIncomingLinks()
Description copied from interface:LogicalSubNetwork
Returns the number of incoming links to the sub-network.- Specified by:
getNumberOfIncomingLinks
in interfaceLogicalSubNetwork
- Returns:
- number of incoming links
-
getNumberOfOutgoingLinks
public int getNumberOfOutgoingLinks()
Description copied from interface:LogicalSubNetwork
Returns the number of outgoing links from the sub-network.- Specified by:
getNumberOfOutgoingLinks
in interfaceLogicalSubNetwork
- Returns:
- number of outgoing links
-
addNode
public void addNode(LogicalNetNode node, boolean isInternal)
Description copied from interface:LogicalSubNetwork
Adds a logical node to the sub-network.- Specified by:
addNode
in interfaceLogicalSubNetwork
- Parameters:
node
- logical nodeisInternal
- set to true, if the node is an internal node; false, otherwise.
-
getInternalNodes
protected LongHashSet getInternalNodes()
-
getLinkLevel
public int getLinkLevel()
Description copied from interface:LogicalBasicNetwork
Returns the link level of the network.- Specified by:
getLinkLevel
in interfaceLogicalBasicNetwork
- Returns:
-
addLink
public void addLink(LogicalNetLink link)
Description copied from interface:LogicalBasicNetwork
Adds a logical link to the network.- Specified by:
addLink
in interfaceLogicalBasicNetwork
- Parameters:
link
- logical link
-
addNode
public void addNode(LogicalNetNode node)
Description copied from interface:LogicalBasicNetwork
Adds a logical node to the network.- Specified by:
addNode
in interfaceLogicalBasicNetwork
-
getName
public java.lang.String getName()
Description copied from interface:LogicalBasicNetwork
Returns the internal network name, for example, the network name stored in network metadata table. Note that the internal network names for different networks are not guaranteed to be unique across multiple database connections.- Specified by:
getName
in interfaceLogicalBasicNetwork
- Returns:
- network name
-
getNumberOfNodes
public int getNumberOfNodes()
Description copied from interface:LogicalBasicNetwork
Returns the total number of nodes in the network.- Specified by:
getNumberOfNodes
in interfaceLogicalBasicNetwork
- Returns:
- number of nodes
-
getNumberOfLinks
public int getNumberOfLinks()
Description copied from interface:LogicalBasicNetwork
Returns the total number of links in the network.- Specified by:
getNumberOfLinks
in interfaceLogicalBasicNetwork
- Returns:
- number of links
-
getNodes
public LogicalNetNode[] getNodes()
Description copied from interface:LogicalBasicNetwork
Returns all the nodes in the network.- Specified by:
getNodes
in interfaceLogicalBasicNetwork
- Returns:
- array of nodes
-
getLinks
public LogicalNetLink[] getLinks()
Description copied from interface:LogicalBasicNetwork
Returns all the links in the network.- Specified by:
getLinks
in interfaceLogicalBasicNetwork
- Returns:
- array of links
-
getNode
public LogicalNetNode getNode(long nodeId)
Description copied from interface:LogicalBasicNetwork
Returns the logical node object for the specified node id.- Specified by:
getNode
in interfaceLogicalBasicNetwork
- Parameters:
nodeId
- node id- Returns:
- logical node object
-
getLink
public LogicalNetLink getLink(long linkId)
Description copied from interface:LogicalBasicNetwork
Returns the logical link object for the specified link id.- Specified by:
getLink
in interfaceLogicalBasicNetwork
- Parameters:
linkId
- link id- Returns:
- logical link object
-
getNodeIds
public long[] getNodeIds()
Description copied from interface:LogicalBasicNetwork
Returns all the node ids in the network.- Specified by:
getNodeIds
in interfaceLogicalBasicNetwork
- Returns:
- array of node ids
-
getLinkIds
public long[] getLinkIds()
Description copied from interface:LogicalBasicNetwork
Returns all the link ids in the network.- Specified by:
getLinkIds
in interfaceLogicalBasicNetwork
- Returns:
- array of link ids
-
isUserDataLoaded
public boolean isUserDataLoaded()
Deprecated.Description copied from interface:LogicalBasicNetwork
Returns whether the user data are loaded to the network.- Specified by:
isUserDataLoaded
in interfaceLogicalBasicNetwork
- Returns:
- true, if the user data are loaded; false, otherwise.
-
setIsUserDataLoaded
public void setIsUserDataLoaded(boolean isUserDataLoaded)
Deprecated.Description copied from interface:LogicalBasicNetwork
Sets whether the user data is loaded to the network.- Specified by:
setIsUserDataLoaded
in interfaceLogicalBasicNetwork
- Parameters:
isUserDataLoaded
- true, if the user data are loaded; false, otherwise.
-
getUserDataCategories
public int[] getUserDataCategories()
Description copied from interface:LogicalBasicNetwork
Returns the user data categories loaded in the network.- Specified by:
getUserDataCategories
in interfaceLogicalBasicNetwork
- Returns:
-
addUserDataCategories
public void addUserDataCategories(int[] userDataCategories)
-
addUserDataCategory
public void addUserDataCategory(int userDataCategory)
Description copied from interface:LogicalBasicNetwork
Adds the user data category that have been loaded to the network.- Specified by:
addUserDataCategory
in interfaceLogicalBasicNetwork
- Parameters:
userDataCategory
- user data category
-
isUserDataCategoryLoaded
public boolean isUserDataCategoryLoaded(int category)
Description copied from interface:LogicalBasicNetwork
Returns whether the specified user data category is loaded.- Specified by:
isUserDataCategoryLoaded
in interfaceLogicalBasicNetwork
- Returns:
-
removeLink
public void removeLink(long linkId)
Description copied from interface:LogicalBasicNetwork
Removes a link from the network.- Specified by:
removeLink
in interfaceLogicalBasicNetwork
- Parameters:
linkId
- ID of the link to be removed
-
getFeatureData
public FeatureData getFeatureData()
Returns the feature data associated to this network.- Specified by:
getFeatureData
in interfaceLogicalBasicNetwork
- Returns:
-
setFeatureData
public void setFeatureData(FeatureData featureData)
Sets the feature data associated to this network.- Specified by:
setFeatureData
in interfaceLogicalBasicNetwork
- Parameters:
featureData
-
-
addFeatureLayer
public void addFeatureLayer(int featureLayerId, FeatureLayer featureLayer)
Description copied from interface:LogicalBasicNetwork
Adds the feature layer.- Specified by:
addFeatureLayer
in interfaceLogicalBasicNetwork
-
isFeatureLayerLoaded
public boolean isFeatureLayerLoaded(int featureLayerId)
Description copied from interface:LogicalBasicNetwork
Returns whether the specified user data category is loaded.- Specified by:
isFeatureLayerLoaded
in interfaceLogicalBasicNetwork
- Returns:
-
-