FileDocCategorySizeDatePackage
LocationImpl.javaAPI DocphoneME MR2 API (J2ME)4686Wed May 02 18:00:40 BST 2007com.sun.j2me.location

LocationImpl

public class LocationImpl extends Location
This class is an implementation of the Location class defined by the JSR-179 specification.

Fields Summary
private static final String
MIMETYPE_NMEA_STRING
private static final String
MIMETYPE_LIF_STRING
private static final String
MIMETYPE_PLAIN_STRING
private boolean
isValid
private long
timestamp
private QualifiedCoordinates
coordinates
private float
speed
private float
course
private int
method
private AddressInfo
address
String
extraInfoNMEA
String
extraInfoLIF
String
extraInfoPlain
String
extraInfoOther
String
extraInfoOtherMIMEType
Constructors Summary
LocationImpl(QualifiedCoordinates coordinates, float speed, float course, int method, AddressInfo address, boolean isValid)


    // JAVADOC COMMENT ELIDED
       
		       
                   
	this.isValid = isValid;
	this.timestamp = System.currentTimeMillis();
	this.coordinates = coordinates;
	this.speed = speed;
	this.course = course;
	this.method = method;
	this.address = address;
    
private LocationImpl()

Methods Summary
public AddressInfogetAddressInfo()

        return address;
    
public floatgetCourse()

        return course;
    
public java.lang.StringgetExtraInfo(java.lang.String mimetype)

        if (mimetype == null) {
            return null;
        }
        if (mimetype.equalsIgnoreCase(MIMETYPE_NMEA_STRING)) {
            return extraInfoNMEA;
        }
        if (mimetype.equalsIgnoreCase(MIMETYPE_LIF_STRING)) {
            return extraInfoLIF;
        }
        if (mimetype.equalsIgnoreCase(MIMETYPE_PLAIN_STRING)) {
            return extraInfoPlain;
        }
        if (mimetype.equalsIgnoreCase(extraInfoOtherMIMEType)) {
            return extraInfoOther;
        }
        return null;
    
public intgetLocationMethod()

        return method;
    
public QualifiedCoordinatesgetQualifiedCoordinates()

        return coordinates;
    
public floatgetSpeed()

        return speed;
    
public longgetTimestamp()

        return timestamp;
    
public booleanisValid()

        return isValid;
    
public voidsetTimestamp(long timestamp)

        if (timestamp == 0) {
            this.timestamp = System.currentTimeMillis();
        } else {
            this.timestamp = timestamp;
        }
    
public voidsetTimestamp()

        timestamp = System.currentTimeMillis();
    
public voidsetValid(boolean isValid)

        this.isValid = isValid;