Package oracle.spatial.network
Interface Link
-
- All Superinterfaces:
java.lang.Cloneable,java.lang.Comparable,java.io.Serializable
public interface Link extends java.lang.Cloneable, java.io.Serializable, java.lang.ComparableThis interface defines a network link.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectclone()Clones the link.double[]computeDistanceRatio(double x, double y)Computes the distance ratio along a spatial link geometry.doublegetActualCost()Returns the cost stored in Link object This function can be used to return the cost stored in the Link object if the getCost() method is overridden by a LinkCostFunction provided by users.Link[]getChildLinkArray()Returns the child links as an array.java.util.IteratorgetChildLinks()Returns the child links as an Iterator.Link[]getCoLinks()Returns the co-links as an array.doublegetCost()Returns the link cost.doublegetDuration()Gets link duration informationdoublegetEndMeasure()Gets the end measure of the referenced LRS geometry.NodegetEndNode()Returns the end node.doublegetEndPercentage()Returns the end percentage if the link is created based on an existing linkdoublegetFlow()Returns the flow on the link after flow analysisJGeometrygetGeometry()Returns the link geometry (JGeometry).intgetGeomID()Returns the LRS geometry ID.intgetID()Returns the link ID.intgetLinkLevel()Returns the link level.java.lang.StringgetName()Returns the link name.NetworkgetNetwork()Returns the network that contains the link.intgetNoOfChildLinks()Gets number of child links Returns 0 if the network is a non-hierarchical networkintgetNoOfSibilingLinks()Gets number of sibling links Sibling links are links with the same parentLinkgetParentLink()Returns the parent link.intgetPartitionID()Returns the link partition IDLinkgetReferenceLink()Gets the reference link if the link is created based on an existing link.Link[]getSiblingLinkArray()Retunrs the sibling links as a Link array.java.util.IteratorgetSiblings()Returns the sibling links as an Iterator.doublegetStartMeasure()Gets the start measure of the referenced LRS geometry.NodegetStartNode()Returns the start node.doublegetStartPercentage()Returns the start percentage if the link is created based on an existing linkbooleangetState()Returns the link state.java.lang.StringgetType()Returns the link type.java.lang.ObjectgetUserData()Gets the user defined data.java.lang.ObjectgetUserData(java.lang.String name)Gets user databooleanisActive()Checks if the link is active.booleanisBidirected()Checks if the link is bidiretcedbooleanisLogical()Checks if the link is logical.booleanisTemporary()Checks if the link is temporary.booleanisUnidirected()Checks if the link is uni-diretcedMDPointlocatePoint(double distanceRatio)Returns the (linearly interpreted) point on the link geometry of the given distance ratio.voidmakeTemporary()Makes the link temporary.MDPoint[]nearestPoint(double x, double y)Returns the nearest point on the link geometry.NodeotherNode(Node node)Returns the other node of the link, if the start node = node, the end node is returned.voidsetBidirected(boolean isBidirected)Makes the directed link bidirectedvoidsetCost(double cost)Sets the link cost.voidsetDuration(double duration)Sets the link durationvoidsetEndNode(Node node)Sets the link end node.voidsetFlow(double flow)Sets the flow on the link for flow analysisvoidsetGeometry(JGeometry geom)Sets the link geometry (JGeometry).voidsetGeomID(int id)Sets the LRS geometry ID of this link.voidsetLinkLevel(int level)Sets the link level.voidsetMeasure(double startMeasure, double endMeasure)Sets the LRS start and end measures.voidsetName(java.lang.String name)Sets the link name.voidsetParentLink(Link link)Sets the parent link.voidsetPartitionID(int partitionID)Sets the link partition IDvoidsetStartNode(Node node)Sets the link start node.voidsetState(boolean state)Sets the active flag.voidsetType(java.lang.String type)Sets the link type.voidsetUserData(java.lang.Object userData)Sets the user defined data.voidsetUserData(java.lang.String name, java.lang.Object data)Sets user data
-
-
-
Method Detail
-
getID
int getID()
Returns the link ID.
-
getName
java.lang.String getName()
Returns the link name.
-
getStartNode
Node getStartNode()
Returns the start node.
-
getEndNode
Node getEndNode()
Returns the end node.
-
getCost
double getCost()
Returns the link cost.
-
getState
boolean getState()
Returns the link state.
-
getLinkLevel
int getLinkLevel()
Returns the link level.
-
getType
java.lang.String getType()
Returns the link type.
-
getNetwork
Network getNetwork()
Returns the network that contains the link.
-
getCoLinks
Link[] getCoLinks()
Returns the co-links as an array. The co-link of a given link is defined as a link with reverse direction. i.e. the start node of the co-link = the end node of the link, and the end node of the co-link = the start node of the link.
-
getParentLink
Link getParentLink()
Returns the parent link.
-
getChildLinkArray
Link[] getChildLinkArray()
Returns the child links as an array.
-
getChildLinks
java.util.Iterator getChildLinks()
Returns the child links as an Iterator.
-
setLinkLevel
void setLinkLevel(int level)
Sets the link level.- Parameters:
level- the link level to be set
-
setType
void setType(java.lang.String type)
Sets the link type.- Parameters:
type- the link type to be set
-
setCost
void setCost(double cost)
Sets the link cost.- Parameters:
cost- the link cost to be set
-
setName
void setName(java.lang.String name)
Sets the link name.- Parameters:
name- the link name to be set
-
setStartNode
void setStartNode(Node node)
Sets the link start node.- Parameters:
node- the start node of the link
-
setEndNode
void setEndNode(Node node)
Sets the link end node.- Parameters:
node- the end node of the link
-
setGeometry
void setGeometry(JGeometry geom)
Sets the link geometry (JGeometry).- Parameters:
geom- the geometry of the link- See Also:
JGeometry
-
setParentLink
void setParentLink(Link link)
Sets the parent link.- Parameters:
link- parent link to be set
-
isTemporary
boolean isTemporary()
Checks if the link is temporary.- Returns:
- true if the link is temporary, false otherwise
-
makeTemporary
void makeTemporary()
Makes the link temporary.
-
otherNode
Node otherNode(Node node)
Returns the other node of the link, if the start node = node, the end node is returned. If the the end node = node, the start node is returned.- Parameters:
node- the specified end node.
-
setGeomID
void setGeomID(int id)
Sets the LRS geometry ID of this link.- Parameters:
id- the LRS geometry ID
-
getGeomID
int getGeomID()
Returns the LRS geometry ID.- Returns:
- the LRS geometry ID
-
setMeasure
void setMeasure(double startMeasure, double endMeasure)Sets the LRS start and end measures.- Parameters:
startMeasure- the start measure of the referenced LRS geometryendMeasure- the end measure of the referenced LRS geometry
-
getStartMeasure
double getStartMeasure()
Gets the start measure of the referenced LRS geometry.- Returns:
- the start measure of the referenced LRS geometry
-
getEndMeasure
double getEndMeasure()
Gets the end measure of the referenced LRS geometry.- Returns:
- the end measure of the referenced LRS geometry
-
isLogical
boolean isLogical()
Checks if the link is logical.
-
isActive
boolean isActive()
Checks if the link is active.
-
isBidirected
boolean isBidirected()
Checks if the link is bidiretced
-
isUnidirected
boolean isUnidirected()
Checks if the link is uni-diretced
-
setBidirected
void setBidirected(boolean isBidirected)
Makes the directed link bidirected
-
getUserData
java.lang.Object getUserData()
Gets the user defined data.- Returns:
- userData the user data as an Object
-
setUserData
void setUserData(java.lang.Object userData)
Sets the user defined data.- Parameters:
userData- the user data as an Object
-
setState
void setState(boolean state)
Sets the active flag.- Parameters:
state- true if active, false otherwise
-
clone
java.lang.Object clone()
Clones the link.
-
getSiblings
java.util.Iterator getSiblings()
Returns the sibling links as an Iterator.
-
getSiblingLinkArray
Link[] getSiblingLinkArray()
Retunrs the sibling links as a Link array.
-
getFlow
double getFlow()
Returns the flow on the link after flow analysis
-
setFlow
void setFlow(double flow)
Sets the flow on the link for flow analysis
-
getDuration
double getDuration()
Gets link duration information
-
setDuration
void setDuration(double duration)
Sets the link duration
-
getPartitionID
int getPartitionID()
Returns the link partition ID
-
setPartitionID
void setPartitionID(int partitionID)
Sets the link partition ID- Parameters:
partitionID- link partition ID
-
setUserData
void setUserData(java.lang.String name, java.lang.Object data)Sets user data- Parameters:
name- name for the user datadata- user data
-
getUserData
java.lang.Object getUserData(java.lang.String name)
Gets user data- Parameters:
name- name for the user data- Returns:
- user data as an Java Object
-
nearestPoint
MDPoint[] nearestPoint(double x, double y) throws NetworkDataException
Returns the nearest point on the link geometry. It throws a NetworkDataException if the link is not a spatial link. It works on linestring geometry only If there exist multiple points with the same minimum distance. All of them will be returned.- Parameters:
x- first ordinate of the given point.y- second ordinate of the given point.- Returns:
- the point(s) (MDPoint array) on the link geometry that has the minimum euclidean distance.
- Throws:
NetworkDataException
-
computeDistanceRatio
double[] computeDistanceRatio(double x, double y) throws NetworkDataExceptionComputes the distance ratio along a spatial link geometry. The given point can be on or off the given link geometry. If the point is off the link geometry, a snap operation is performed to the point(s) on the link geometry that has the minimum distance to the given point (x,y). If there exist multiple points with the same minimum distance, all of them will be returned. It works on linestring geometry only. The (Euclidean) distance is computed from the start point of the link geometry. The distance ratio is the distance divided by the link geometry length. For non-spatial links, a NetworkDataException will be thrown.- Parameters:
x- first ordinate of the given pointy- second ordinate of the given point- Returns:
- the distance ratio array (between 0.0 and 1.0 inclusive)
- Throws:
NetworkDataException
-
locatePoint
MDPoint locatePoint(double distanceRatio) throws NetworkDataException
Returns the (linearly interpreted) point on the link geometry of the given distance ratio. The (Euclidean) distance ratio is between 0.0 and 1.0 The ratio is defined as the distance from the start point to this point over the distance (length) of the link geometry. This function works on linestring geometry. It throws a NetworkDataException if the link is non-spatial or non-linestring geometry- Parameters:
distanceRatio- the distance ratio (Euclidean distance)- Returns:
- the point (MDPoint) identified by the given distance ratio
- Throws:
NetworkDataException
-
getNoOfChildLinks
int getNoOfChildLinks()
Gets number of child links Returns 0 if the network is a non-hierarchical network
-
getNoOfSibilingLinks
int getNoOfSibilingLinks()
Gets number of sibling links Sibling links are links with the same parent
-
getReferenceLink
Link getReferenceLink()
Gets the reference link if the link is created based on an existing link. Such links are further identified by a start percentage and end percentage.
-
getStartPercentage
double getStartPercentage()
Returns the start percentage if the link is created based on an existing link
-
getEndPercentage
double getEndPercentage()
Returns the end percentage if the link is created based on an existing link
-
getActualCost
double getActualCost()
Returns the cost stored in Link object This function can be used to return the cost stored in the Link object if the getCost() method is overridden by a LinkCostFunction provided by users.- Returns:
- cost stored in the link object
-
-