Package oracle.spatial.network.lod
Class PointOnNet
- java.lang.Object
-
- oracle.spatial.network.lod.PointOnNet
-
- Direct Known Subclasses:
HeavyPointOnNet
public class PointOnNet extends java.lang.Object
This class defines the methods supported by a point on a network. A point on a network can fall on a node or in the middle of a link. User data associated with a PointOnNet can be used in network constraints, cost calculators or heuristic cost functions, etc. For example, the heuristic cost function used in A* shortest path search needs to know the location of the end point. If the end point is specified using link ID and a percentage, then the user must set the location user data of the end point either by passing it to the PointOnNet constructor or by calling setUserData method on the PointOnNet object. The following is an example on how to set the user data in a PointOnNet object.double xCoordinate = -122.45; double yCoordinate = 37.77; PointOnNet point = new PointOnNet(linkId, percentage); Object[] userDataObjects = {xCoordinate, yCoordinate}; UserData userData = new UserDataImpl(userDataObjects); point.setUserData(userData);
- Since:
- 11gR1
-
-
Constructor Summary
Constructors Constructor Description PointOnNet(long nodeId)
Constructs a PointOnNet for a node.PointOnNet(long linkId, double percentage)
Constructs a PointOnNet for a point on link.PointOnNet(long linkId, double percentage, CategorizedUserData cud)
Constructs a PointOnNet for a point on link.PointOnNet(long linkId, double percentage, UserData userData)
Constructs a PointOnNet for a point on link.PointOnNet(long nodeId, CategorizedUserData cud)
Constructs a PointOnNet for a node.PointOnNet(long nodeId, UserData userData)
Constructs a PointOnNet for a node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Support cloneableboolean
equals(java.lang.Object o)
CategorizedUserData
getCategorizedUserData()
long
getLinkId()
Returns the link ID, if the point falls on a link.long
getNodeId()
Returns the node ID, if the point falls on a node.double
getPercentage()
Returns the percentage on the link, if the point falls on a link.UserData
getUserData()
Returns the user data associated with this point on net in the default user data category.UserData
getUserData(int category)
int
hashCode()
boolean
isNode()
Checks whether this point falls on a node or not.boolean
isPointOnLink()
Checks whether this point falls on a link or not.void
removeUserData()
Removes all user data associated to this object.void
setCategorizedUserData(CategorizedUserData cud)
void
setUserData(int category, UserData userData)
void
setUserData(UserData userData)
Sets user data.java.lang.String
toString()
-
-
-
Constructor Detail
-
PointOnNet
public PointOnNet(long nodeId)
Constructs a PointOnNet for a node.- Parameters:
nodeId
- node ID
-
PointOnNet
public PointOnNet(long linkId, double percentage)
Constructs a PointOnNet for a point on link.- Parameters:
linkId
- link IDpercentage
- percentage on the link
-
PointOnNet
public PointOnNet(long nodeId, CategorizedUserData cud)
Constructs a PointOnNet for a node.- Parameters:
nodeId
- node IDcud
- categorized user data
-
PointOnNet
public PointOnNet(long nodeId, UserData userData)
Constructs a PointOnNet for a node.- Parameters:
nodeId
- node IDuserData
- user data
-
PointOnNet
public PointOnNet(long linkId, double percentage, CategorizedUserData cud)
Constructs a PointOnNet for a point on link.- Parameters:
linkId
- link IDpercentage
- percentage on the linkcud
- categorized user data
-
PointOnNet
public PointOnNet(long linkId, double percentage, UserData userData)
Constructs a PointOnNet for a point on link.- Parameters:
linkId
- link IDpercentage
- percentage on the linkuserData
- user data
-
-
Method Detail
-
isNode
public boolean isNode()
Checks whether this point falls on a node or not.- Returns:
- true if the point falls on a node; false, if the point falls on a link.
-
isPointOnLink
public boolean isPointOnLink()
Checks whether this point falls on a link or not.- Returns:
- true if the point falls on a link; false, if the point falls on a node.
-
getNodeId
public long getNodeId()
Returns the node ID, if the point falls on a node.- Returns:
- the node ID, if the point falls on a node.
-
getLinkId
public long getLinkId()
Returns the link ID, if the point falls on a link.- Returns:
- the link ID, if the point falls on a link.
-
getPercentage
public double getPercentage()
Returns the percentage on the link, if the point falls on a link.- Returns:
- the percentage on the link, if the point falls on a link.
-
getUserData
public UserData getUserData()
Returns the user data associated with this point on net in the default user data category.- Returns:
- user data
-
setUserData
public void setUserData(UserData userData)
Sets user data. Overwrite previous value, if the user data already exists.- Parameters:
userData
- user data
-
removeUserData
public void removeUserData()
Removes all user data associated to this object.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getCategorizedUserData
public CategorizedUserData getCategorizedUserData()
-
setCategorizedUserData
public void setCategorizedUserData(CategorizedUserData cud)
-
getUserData
public UserData getUserData(int category)
-
setUserData
public void setUserData(int category, UserData userData)
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Support cloneable- Overrides:
clone
in classjava.lang.Object
- Returns:
- cloned object
- Throws:
java.lang.CloneNotSupportedException
-
-