com.mapquest
Class RouteMatrixResults

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

public class RouteMatrixResults
extends MQObject

Contains the results of a route matrix request.


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
RouteMatrixResults()
          Default constructor.
RouteMatrixResults(RouteMatrixResults rr)
          Copy Constructor, which creates a new RouteMatrixResults 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.
 boolean getAllToAllFlag()
          Gets the all-to-all flag.
 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(int from, int to)
          Returns the calculated distance of the route.
 RouteMatrixResultsCode getResultCode()
          Returns the result code member of this object.
 StringCollection getResultMessages()
          Returns the messages returned by Server.
 int getTime(int from, int to)
          Returns the calculated elapsed time in seconds for the route.
 int hashCode()
          Returns a hash code for this RouteMatrixResults.
 void init()
          Initializes object.
 void setCoverageName(java.lang.String newCoverageName)
          Sets the Coverage name used to perform this route.
 void setResultCode(RouteMatrixResultsCode 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

RouteMatrixResults

public RouteMatrixResults()
Default constructor.


RouteMatrixResults

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

Parameters:
rr - An existing RouteMatrixResults 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.

getTime

public int getTime(int from,
                   int to)
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(int from,
                          int to)
Returns the calculated distance of the route.

Returns:
The calculated total distance of the route.

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(RouteMatrixResultsCode rCode)
Sets the result code member of this object.

Parameters:
rCode - a long value containing the code

getResultCode

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

Returns:
a long value containing the code

getAllToAllFlag

public boolean getAllToAllFlag()
Gets the all-to-all flag.

Returns:
Returns the allToAll flag. True if the matrix is from each location to each other, False if from location 0 to all others.

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 RouteMatrixResults object that has same attributes as this object.

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

hashCode

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

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