org.placelab.jsr0179
Class LocationImpl

java.lang.Object
  extended byjavax.microedition.location.Location
      extended byorg.placelab.jsr0179.LocationImpl

public class LocationImpl
extends javax.microedition.location.Location


Field Summary
 
Fields inherited from class javax.microedition.location.Location
MTA_ASSISTED, MTA_UNASSISTED, MTE_ANGLEOFARRIVAL, MTE_CELLID, MTE_SATELLITE, MTE_SHORTRANGE, MTE_TIMEDIFFERENCE, MTE_TIMEOFARRIVAL, MTY_NETWORKBASED, MTY_TERMINALBASED
 
Constructor Summary
LocationImpl(Estimate estimate)
           
LocationImpl(Estimate estimate, java.lang.String extraInfo)
           
 
Method Summary
 javax.microedition.location.AddressInfo getAddressInfo()
          Returns the AddressInfo associated with this Location object.
 float getCourse()
          Returns the terminal's course made good in degrees relative to true north.
 java.lang.String getExtraInfo(java.lang.String mimetyp)
          Returns extra information about the location.
 int getLocationMethod()
          Returns information about the location method used.
 javax.microedition.location.QualifiedCoordinates getQualifiedCoordinates()
          Returns the coordinates of this location and their accuracy.
 float getSpeed()
          Returns the terminal's current ground speed in meters per second (m/s) at the time of measurement.
 long getTimestamp()
          Returns the time stamp at which the data was collected.
 boolean isValid()
          Returns whether this Location instance represents a valid location with coordinates or an invalid one where all the data, especially the latitude and longitude coordinates, may not be present.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationImpl

public LocationImpl(Estimate estimate)

LocationImpl

public LocationImpl(Estimate estimate,
                    java.lang.String extraInfo)
Method Detail

getAddressInfo

public javax.microedition.location.AddressInfo getAddressInfo()
Description copied from class: javax.microedition.location.Location
Returns the AddressInfo associated with this Location object. If no address is available, null is returned.

Returns:
an AddressInfo associated with this Location object

getLocationMethod

public int getLocationMethod()
Description copied from class: javax.microedition.location.Location
Returns information about the location method used. The returned value is a bitwise combination (OR) of the method technology, method type and assistance information. The method technology values are defined as constant values named MTE_* in this class, the method type values are named MTY_* and assistance information values are named MTA_*. For example, if the location method used is terminal based, network assisted E-OTD, the value 0x00050002 ( = MTY_TERMINALBASED | MTA_ASSISTED | MTE_TIMEDIFFERENCE) would be returned. If the location is determined by combining several location technologies, the returned value may have several MTE_* bits set. If the used location method is unknown, the returned value must have all the bits set to zero. Only bits that have defined constants within this class are allowed to be used. Other bits are reserved and must be set to 0.

Returns:
a bitfield identifying the used location method

getTimestamp

public long getTimestamp()
Description copied from class: javax.microedition.location.Location
Returns the time stamp at which the data was collected. This timestamp should represent the point in time when the measurements were made. Implementations make best effort to set the timestamp as close to this point in time as possible. The time returned is the time of the local clock in the terminal in milliseconds using the same clock and same time representation as System.currentTimeMillis().

Returns:
a timestamp representing the time
See Also:
System.currentTimeMillis()

getExtraInfo

public java.lang.String getExtraInfo(java.lang.String mimetyp)
Description copied from class: javax.microedition.location.Location
Returns extra information about the location. This method is intended to provide location method specific extra information that applications that are aware of the used location method and information format are able to use. A MIME type is used to identify the type of the extra information when requesting it. If the implementation supports this type, it returns the extra information as a String encoded according to format identified by the MIME type. If the implementation does not support this type, the method returns null. This specification does not require implementations to support any extra information type. The following MIME types are defined here together with their definitions in order to ensure interoperability of implementations wishing to use these types. The definition of these types here is not an indication that these formats are preferred over any other format not defined here. When the MIME type is "application/X-jsr179-location-nmea", the returned string shall be a valid sequence of NMEA sentences formatted according to the syntax specified in the NMEA 0183 v3.1 specification. These sentences shall represent the set of NMEA sentences that are related to this location at the time this location was created. When the MIME type is "application/X-jsr179-location-lif", the returned string shall contain an XML formatted document containing the "pd" element defined in the LIF Mobile Location Protocol TS 101 v3.0.0 as the root element of the document. When the MIME type is "text/plain", the returned string shall contain textual extra information that can be displayed to the end user.

Parameters:
mimetyp - the MIME type of the requested extra information
Returns:
string encoded according to the format identified by the MIME type defined in the parameter. null if the information for the requested MIME type is not available or not supported by this implementation.

getQualifiedCoordinates

public javax.microedition.location.QualifiedCoordinates getQualifiedCoordinates()
Description copied from class: javax.microedition.location.Location
Returns the coordinates of this location and their accuracy.

Returns:
QualifiedCoordinates object. If the coordinates are not known, returns null

getCourse

public float getCourse()
Description copied from class: javax.microedition.location.Location
Returns the terminal's course made good in degrees relative to true north. The value is always in the range [0.0,360.0) degrees.

Returns:
the terminal's course made good in degrees relative to true north or Float.NaN if the course is not known

getSpeed

public float getSpeed()
Description copied from class: javax.microedition.location.Location
Returns the terminal's current ground speed in meters per second (m/s) at the time of measurement. The speed is always a non-negative value. Note that unlike the coordinates, speed does not have an associated accuracy because the methods used to determine the speed typically are not able to indicate the accuracy.

Returns:
the current ground speed in m/s for the terminal or Float.NaN if the speed is not known

isValid

public boolean isValid()
Description copied from class: javax.microedition.location.Location
Returns whether this Location instance represents a valid location with coordinates or an invalid one where all the data, especially the latitude and longitude coordinates, may not be present. A valid Location object contains valid coordinates whereas an invalid Location object may not contain valid coordinates but may contain other information via the getExtraInfo() method to provide information on why it was not possible to provide a valid Location object.

Returns:
a boolean value with true indicating that this Location instance is valid and false indicating an invalid Location instance
See Also:
Location.getExtraInfo(String)