|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.location.Location
The Location class represents the standard set of basic location information. This includes the timestamped coordinates, accuracy, speed, heading, and information about the positioning method used for the location, plus an optional address. The location method is indicated using a bit field. The individual bits are defined using constants in this class. This bit field is a bitwise combination of the location method technology bits (MTE_*), method type (MTY_*) and method assistance information (MTA_*). All other bits in the 32 bit integer than those that have defined constants in this class are reserved and MUST not be set by implementations (i.e. these bits must be 0). A Location object may be either 'valid' or 'invalid'. The validity can be queried using the isValid method. A valid Location object represents a location with valid coordinates. An invalid Location object doesn't have valid coordinates, but the extra info that is obtained from the getExtraInfo method can provide information about the reason why it was not possible to provide a valid Location. The periodic location updates to the LocationListener may return invalid Location objects if it isn't possible to determine the location. This class is only a container for the information. When the platform implementation returns Location objects, it MUST ensure that it only returns objects where the parameters have values set as described for their semantics in this class. This class is extracted from JSR179
Field Summary | |
static int |
MTA_ASSISTED
Location method is assisted by the other party (Terminal assisted for Network based, Network assisted for terminal based). |
static int |
MTA_UNASSISTED
Location method is unassisted. |
static int |
MTE_ANGLEOFARRIVAL
Location method Angle of Arrival for cellular / terrestrial RF system. |
static int |
MTE_CELLID
Location method Cell-ID for cellular (in GSM, this is the same as CGI, Cell Global Identity). |
static int |
MTE_SATELLITE
Location method using satellites (for example, Global Positioning System (GPS)). |
static int |
MTE_SHORTRANGE
Location method Short-range positioning system (for example, Bluetooth LP). |
static int |
MTE_TIMEDIFFERENCE
Location method Time Difference for cellular / terrestrial RF system (for example, Enhanced Observed Time Difference (E-OTD) for GSM). |
static int |
MTE_TIMEOFARRIVAL
Location method Time of Arrival (TOA) for cellular / terrestrial RF system. |
static int |
MTY_NETWORKBASED
Location method is of type network based. |
static int |
MTY_TERMINALBASED
Location method is of type terminal based. |
Constructor Summary | |
Location()
|
Method Summary | |
void |
addExtraInfo(String mimetype,
String extrainfo)
Adds a feature to the ExtraInfo attribute of the Location object |
QualifiedCoordinates |
getCoordinates()
Returns the coordinates of this location and their accuracy. |
float |
getCourse()
Returns the terminal's course made good in degrees relative to true north. |
String |
getExtraInfo(String mimetype)
Returns extra information about the location. |
int |
getLocationMethod()
Returns information about the location method used. |
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. |
void |
setCoordinates(QualifiedCoordinates coordinates)
Sets the coordinates attribute of the Location object |
void |
setCourse(float course)
|
void |
setLocationMethod(int locationMethod)
Sets the locationMethod attribute of the Location object |
void |
setSpeed(float speed)
Sets the speed attribute of the Location object |
void |
setTimestamp(long timestamp)
Sets the timestamp attribute of the Location object |
void |
setValid(boolean valid)
Sets the valid attribute of the Location object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MTA_ASSISTED
public static final int MTA_UNASSISTED
public static final int MTE_ANGLEOFARRIVAL
public static final int MTE_CELLID
public static final int MTE_SATELLITE
public static final int MTE_SHORTRANGE
public static final int MTE_TIMEDIFFERENCE
public static final int MTE_TIMEOFARRIVAL
public static final int MTY_NETWORKBASED
public static final int MTY_TERMINALBASED
Constructor Detail |
public Location()
Method Detail |
public int getLocationMethod()
public void setLocationMethod(int locationMethod)
locationMethod
- The new locationMethod valuepublic QualifiedCoordinates getCoordinates()
public void setCoordinates(QualifiedCoordinates coordinates)
coordinates
- The new coordinates valuepublic float getSpeed()
public void setSpeed(float speed)
speed
- The new speed valuepublic float getCourse()
public void setCourse(float course)
public long getTimestamp()
public void setTimestamp(long timestamp)
timestamp
- The new timestamp valuepublic boolean isValid()
public void setValid(boolean valid)
valid
- The new valid valuepublic String getExtraInfo(String mimetype)
mimetype
- the MIME type of the requested extra information
public void addExtraInfo(String mimetype, String extrainfo)
mimetype
- The feature to be added to the ExtraInfo attributeextrainfo
- The feature to be added to the ExtraInfo attribute
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |