com.mapquest
Class RouteResults

java.lang.Object
  extended bycom.mapquest.MQObject
      extended bycom.mapquest.RouteResults
All Implemented Interfaces:
java.lang.Cloneable

public class RouteResults
extends MQObject

Contains the results of a routing request.

See Also:
LatLngCollection, LocationCollection, RouteResultsCode, StringCollection, TrekRouteCollection

Field Summary
static int CLASS_ID
           
static java.lang.String CLASS_NAME
           
 
Fields inherited from class com.mapquest.MQObject
DEFAULT_ID, DEFAULT_NAME, DEFAULT_VERSION, FORMAT_NUMERIC_ID, FORMAT_TEXT_NAME, INVALID_ID, INVALID_NAME, INVALID_VERSION
 
Constructor Summary
RouteResults()
          Default constructor.
RouteResults(RouteResults rr)
          Copy Constructor, which creates a new RouteResults object which is a duplicate of the one passed in.
 
Method Summary
 boolean equals(java.lang.Object otherObject)
          Compares this object to the specified object.
 int getClassId()
          Returns the numeric id of this class.
 java.lang.String getClassName()
          Returns the text name of this class.
 java.lang.String getCoverageName()
          Gets the Coverage name used to perform this route.
 double getDistance()
          Returns the calculated distance of the route.
 LocationCollection getLocations()
          Returns all Locations used in the route.
 RouteResultsCode getResultCode()
          Returns the result code member of this object.
 StringCollection getResultMessages()
          Returns the messages returned by Server.
 LatLngCollection getShapePoints()
          Returns the LatLngCollection member of this object.
 int getTime()
          Returns the calculated elapsed time in seconds for the route.
 TrekRouteCollection getTrekRoutes()
          Returns the TrekRouteCollection member of this object.
 int hashCode()
          Returns a hash code for this RouteResults.
 void init()
          Initializes object.
 void setCoverageName(java.lang.String newCoverageName)
          Sets the Coverage name used to perform this route.
 void setResultCode(RouteResultsCode rCode)
          Sets the result code member of this object.
 
Methods inherited from class com.mapquest.MQObject
clone, getFormat, getIdWithVersion, getNameWithVersion, getObjectVersion, getTypeId, getTypeName, getVerboseConsoleOutput, setFormat, setObjectVersion, setVerboseConsoleOutput, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_ID

public static final int CLASS_ID
See Also:
Constant Field Values

CLASS_NAME

public static final java.lang.String CLASS_NAME
See Also:
Constant Field Values
Constructor Detail

RouteResults

public RouteResults()
Default constructor.


RouteResults

public RouteResults(RouteResults rr)
Copy Constructor, which creates a new RouteResults object which is a duplicate of the one passed in.

Parameters:
rr - An existing RouteResults object which is to be duplicated in the new one.
Method Detail

init

public void init()
Initializes object.

Overrides:
init in class MQObject

getClassId

public int getClassId()
Returns the numeric id of this class.

Overrides:
getClassId in class MQObject
Returns:
the numeric id of this class.

getClassName

public java.lang.String getClassName()
Returns the text name of this class.

Overrides:
getClassName in class MQObject
Returns:
the text name of this class.

getCoverageName

public java.lang.String getCoverageName()
Gets the Coverage name used to perform this route.

Returns:
the Coverage name used to perform this route.

setCoverageName

public void setCoverageName(java.lang.String newCoverageName)
Sets the Coverage name used to perform this route.

Parameters:
newCoverageName - the Coverage name used to perform this route.

getLocations

public LocationCollection getLocations()
Returns all Locations used in the route. LatLng may be altered to closest point on found road segment. Locations may be re-ordered in the case of an optimized route

Returns:
The location collection object

getTime

public int getTime()
Returns the calculated elapsed time in seconds for the route.

Returns:
The calculated elapsed time in seconds for traversing the route.

getDistance

public double getDistance()
Returns the calculated distance of the route.

Returns:
The calculated total distance of the route.

getTrekRoutes

public TrekRouteCollection getTrekRoutes()
Returns the TrekRouteCollection member of this object.

Returns:
a TrekRouteCollection object

getShapePoints

public LatLngCollection getShapePoints()
Returns the LatLngCollection member of this object.

Returns:
a LatLngCollection object

getResultMessages

public StringCollection getResultMessages()
Returns the messages returned by Server. Each result message should contain a unique number followed by a text description. Ex: "200 Unable to calculate route." Messages for invalid locations should be numbered 100..199 Messages for route failures should be numbered 200..99

Returns:
a String Collection object

setResultCode

public void setResultCode(RouteResultsCode rCode)
Sets the result code member of this object.

Parameters:
rCode - a long value containing the code

getResultCode

public RouteResultsCode getResultCode()
Returns the result code member of this object.

Returns:
a long value containing the code

equals

public boolean equals(java.lang.Object otherObject)
Compares this object to the specified object. The result is true if and only if the argument is not null and is a RouteResults object that has same attributes as this object.

Overrides:
equals in class MQObject
Parameters:
otherObject - the object to compare this RouteResults against.
Returns:
true if the RouteResults objects are equal; false otherwise.

hashCode

public int hashCode()
Returns a hash code for this RouteResults.

Overrides:
hashCode in class MQObject
Returns:
a hash code value for this RouteResults.