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

LandmarkImpl

public class LandmarkImpl extends Object
This class is an implementation of the Landmark class defined by the JSR-179 specification.

Fields Summary
int
recordId
String
storeName
String
name
String
description
boolean
isCoordinates
double
latitude
double
longitude
float
altitude
float
horizontalAccuracy
float
verticalAccuracy
boolean
isAddressInfo
int
numAddressInfoFields
String
AddressInfo_EXTENSION
String
AddressInfo_STREET
String
AddressInfo_POSTAL_CODE
String
AddressInfo_CITY
String
AddressInfo_COUNTY
String
AddressInfo_STATE
String
AddressInfo_COUNTRY
String
AddressInfo_COUNTRY_CODE
String
AddressInfo_DISTRICT
String
AddressInfo_BUILDING_NAME
String
AddressInfo_BUILDING_FLOOR
String
AddressInfo_BUILDING_ROOM
String
AddressInfo_BUILDING_ZONE
String
AddressInfo_CROSSING1
String
AddressInfo_CROSSING2
String
AddressInfo_URL
String
AddressInfo_PHONE_NUMBER
Constructors Summary
public LandmarkImpl(String name, String description, QualifiedCoordinates coordinates, AddressInfo addressInfo)


    // JAVADOC COMMENT ELIDED
         
		     
		      
        setName(name);
        this.description = description;
        setQualifiedCoordinates(coordinates);
        setAddressInfo(addressInfo);
    
Methods Summary
java.lang.StringasString()

        StringBuffer buf = new StringBuffer();
        String coordinates;
        if (isCoordinates) {
            coordinates = "Lat: " + latitude +
		" Lon: " + longitude;
        } else {
            coordinates = "null";
        }
        return "Landmark: { storeName = " + storeName +
	    " recordId = " + recordId +
	    " name = " + name +
	    " description = " + description +
	    " coordinates = " + coordinates +
	    " addressInfo = " + getAddressInfo() + " }";
    
public booleanequals(java.lang.Object o)

        if (!(o instanceof LandmarkImpl)) {
            return false;
        }
        if (this == o) {
            return true;
        }
        LandmarkImpl lm = (LandmarkImpl)o;
        boolean idEquals = recordId == lm.recordId;
        boolean storeEquals = (storeName == lm.storeName) ||
	    ((storeName != null) && storeName.equals(lm.storeName));
        return idEquals && storeEquals;
    
public AddressInfogetAddressInfo()

        if(isAddressInfo) {
            AddressInfo address = new AddressInfo();
            address.setField(AddressInfo.EXTENSION, AddressInfo_EXTENSION);
            address.setField(AddressInfo.STREET, AddressInfo_STREET);
            address.setField(AddressInfo.POSTAL_CODE, AddressInfo_POSTAL_CODE);
            address.setField(AddressInfo.CITY, AddressInfo_CITY);
            address.setField(AddressInfo.COUNTY, AddressInfo_COUNTY);
            address.setField(AddressInfo.STATE, AddressInfo_STATE);
            address.setField(AddressInfo.COUNTRY, AddressInfo_COUNTRY);
            address.setField(AddressInfo.COUNTRY_CODE, 
                            AddressInfo_COUNTRY_CODE);
            address.setField(AddressInfo.DISTRICT, AddressInfo_DISTRICT);
            address.setField(AddressInfo.BUILDING_NAME, 
                            AddressInfo_BUILDING_NAME);
            address.setField(AddressInfo.BUILDING_FLOOR, 
                            AddressInfo_BUILDING_FLOOR);
            address.setField(AddressInfo.BUILDING_ROOM, 
                            AddressInfo_BUILDING_ROOM);
            address.setField(AddressInfo.BUILDING_ZONE, 
                            AddressInfo_BUILDING_ZONE);
            address.setField(AddressInfo.CROSSING1, AddressInfo_CROSSING1);
            address.setField(AddressInfo.CROSSING2, AddressInfo_CROSSING2);
            address.setField(AddressInfo.URL, AddressInfo_URL);
            address.setField(AddressInfo.PHONE_NUMBER, 
                            AddressInfo_PHONE_NUMBER);
            return address;
        }
        return null;
    
public java.lang.StringgetDescription()

        return description;
    
public java.lang.StringgetName()

        return name;
    
public QualifiedCoordinatesgetQualifiedCoordinates()

        if (isCoordinates) {
            return new QualifiedCoordinates(latitude, longitude, altitude,
                        horizontalAccuracy,  verticalAccuracy);
        }
        return null;
    
intgetRecordId()

        return recordId;
    
java.lang.StringgetStoreName()

        return storeName;
    
private static native voidinitNativeClass()

public voidsetAddressInfo(AddressInfo address)

        if (address != null) {
            numAddressInfoFields = 0;
            AddressInfo_EXTENSION = address.getField(AddressInfo.EXTENSION);
            if(AddressInfo_EXTENSION != null) {
                numAddressInfoFields++;
            }
            AddressInfo_STREET = address.getField(AddressInfo.STREET);
            if(AddressInfo_STREET != null) {
                numAddressInfoFields++;
            }
            AddressInfo_POSTAL_CODE = address.getField(AddressInfo.POSTAL_CODE);
            if(AddressInfo_POSTAL_CODE != null) {
                numAddressInfoFields++;
            }
            AddressInfo_CITY = address.getField(AddressInfo.CITY);
            if(AddressInfo_CITY != null) {
                numAddressInfoFields++;
            }
            AddressInfo_COUNTY = address.getField(AddressInfo.COUNTY);
            if(AddressInfo_COUNTY != null) {
                numAddressInfoFields++;
            }
            AddressInfo_STATE = address.getField(AddressInfo.STATE);
            if(AddressInfo_STATE != null) {
                numAddressInfoFields++;
            }
            AddressInfo_COUNTRY = address.getField(AddressInfo.COUNTRY);
            if(AddressInfo_COUNTRY != null) {
                numAddressInfoFields++;
            }
            AddressInfo_COUNTRY_CODE = 
                    address.getField(AddressInfo.COUNTRY_CODE);
            if(AddressInfo_COUNTRY_CODE != null) {
                numAddressInfoFields++;
            }
            AddressInfo_DISTRICT = address.getField(AddressInfo.DISTRICT);
            if(AddressInfo_DISTRICT != null) {
                numAddressInfoFields++;
            }
            AddressInfo_BUILDING_NAME = 
                    address.getField(AddressInfo.BUILDING_NAME);
            if(AddressInfo_BUILDING_NAME != null) {
                numAddressInfoFields++;
            }
            AddressInfo_BUILDING_FLOOR = 
                    address.getField(AddressInfo.BUILDING_FLOOR);
            if(AddressInfo_BUILDING_FLOOR != null) {
                numAddressInfoFields++;
            }
            AddressInfo_BUILDING_ROOM = 
                    address.getField(AddressInfo.BUILDING_ROOM);
            if(AddressInfo_BUILDING_ROOM != null) {
                numAddressInfoFields++;
            }
            AddressInfo_BUILDING_ZONE = 
                    address.getField(AddressInfo.BUILDING_ZONE);
            if(AddressInfo_BUILDING_ZONE != null) {
                numAddressInfoFields++;
            }
            AddressInfo_CROSSING1 = address.getField(AddressInfo.CROSSING1);
            if(AddressInfo_CROSSING1 != null) {
                numAddressInfoFields++;
            }
            AddressInfo_CROSSING2 = address.getField(AddressInfo.CROSSING2);
            if(AddressInfo_CROSSING2 != null) {
                numAddressInfoFields++;
            }
            AddressInfo_URL = address.getField(AddressInfo.URL);
            if(AddressInfo_URL != null) {
                numAddressInfoFields++;
            }
            AddressInfo_PHONE_NUMBER = 
                    address.getField(AddressInfo.PHONE_NUMBER);
            if(AddressInfo_PHONE_NUMBER != null) {
                numAddressInfoFields++;
            }
            isAddressInfo = true;
        } else {
            AddressInfo_EXTENSION = null;
            AddressInfo_STREET = null;
            AddressInfo_POSTAL_CODE = null;
            AddressInfo_CITY = null;
            AddressInfo_COUNTY = null;
            AddressInfo_STATE = null;
            AddressInfo_COUNTRY = null;
            AddressInfo_COUNTRY_CODE = null;
            AddressInfo_DISTRICT = null;
            AddressInfo_BUILDING_NAME = null;
            AddressInfo_BUILDING_FLOOR = null;
            AddressInfo_BUILDING_ROOM = null;
            AddressInfo_BUILDING_ZONE = null;
            AddressInfo_CROSSING1 = null;
            AddressInfo_CROSSING2 = null;
            AddressInfo_URL = null;
            AddressInfo_PHONE_NUMBER = null;
            numAddressInfoFields = 0;
            isAddressInfo = false;
        }
    
public voidsetDescription(java.lang.String description)

        this.description = description;
    
public voidsetName(java.lang.String name)

        if (name == null) {
            throw new NullPointerException();
        }
        this.name = name;
    
public voidsetQualifiedCoordinates(QualifiedCoordinates coordinates)

        if (coordinates != null) {
            latitude = coordinates.getLatitude();
            longitude = coordinates.getLongitude();
            altitude = coordinates.getAltitude();
            horizontalAccuracy = coordinates.getHorizontalAccuracy();
            verticalAccuracy = coordinates.getVerticalAccuracy();
            isCoordinates = true;
        } else {
            latitude = 0;
            longitude = 0;
            altitude = 0;
            horizontalAccuracy = 0;
            verticalAccuracy = 0;
            isCoordinates = false;
        }
    
voidsetRecordId(int recordId)

        this.recordId = recordId;
    
voidsetStoreName(java.lang.String storeName)

        this.storeName = storeName;