javax.microedition.location
Class Landmark

java.lang.Object
  extended by javax.microedition.location.Landmark

public class Landmark
extends Object

The Landmark class represents a landmark, i.e. a known location with a name. A landmark has a name by which it is known to the end user, a textual description, QualifiedCoordinates and optionally AddressInfo.

This class is only a container for the information. The constructor does not validate the parameters passed in but just stores the values, except the name field is never allowed to be null. The get* methods return the values passed in the constructor or if the values are later modified by calling the set* methods, the get* methods return the modified values. The QualifiedCoordinates object inside the landmark is a mutable object and the Landmark object holds only a reference to it. Therefore, it is possible to modify the QualifiedCoordinates object inside the Landmark object by calling the set* methods in the QualifiedCoordinates object. However, any such dynamic modifications affect only the Landmark object instance, but MUST not automatically update the persistent landmark information in the landmark store. The LandmarkStore.updateLandmark method is the only way to commit the modifications to the persistent landmark store.

When the platform implementation returns Landmark objects, it MUST ensure that it only returns objects where the parameters have values set as described for their semantics in this class.


Constructor Summary
Landmark(String name, String description, QualifiedCoordinates coordinates, AddressInfo addressInfo)
          Constructs a new Landmark object with the values specified.
 
Method Summary
 AddressInfo getAddressInfo()
          Gets the AddressInfo of the landmark.
 String getDescription()
          Gets the landmark description.
 String getName()
          Gets the landmark name.
 QualifiedCoordinates getQualifiedCoordinates()
          Gets the QualifiedCoordinates of the landmark.
 void setAddressInfo(AddressInfo addressInfo)
          Sets the AddressInfo of the landmark.
 void setDescription(String description)
          Sets the description of the landmark.
 void setName(String name)
          Sets the name of the landmark.
 void setQualifiedCoordinates(QualifiedCoordinates coordinates)
          Sets the QualifiedCoordinates of the landmark.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Landmark

public Landmark(String name,
                String description,
                QualifiedCoordinates coordinates,
                AddressInfo addressInfo)
         throws NullPointerException
Constructs a new Landmark object with the values specified.

Parameters:
name - the name of the landmark
description - description of the landmark. May be null if not available.
coordinates - the Coordinates of the landmark. May be null if not known.
addressInfo - the textual address information of the landmark. May be null if not known.
Throws:
NullPointerException - if the name is null
Method Detail

getAddressInfo

public AddressInfo getAddressInfo()
Gets the AddressInfo of the landmark.

Returns:
the AddressInfo of the landmark.
See Also:
setAddressInfo(AddressInfo)

getDescription

public String getDescription()
Gets the landmark description.

Returns:
the description of the landmark, null if not available.
See Also:
setDescription(String)

getName

public String getName()
Gets the landmark name.

Returns:
the name of the landmark.
See Also:
setName(String)

getQualifiedCoordinates

public QualifiedCoordinates getQualifiedCoordinates()
Gets the QualifiedCoordinates of the landmark.

Returns:
the QualifiedCoordinates of the landmark. null if not available.
See Also:
setQualifiedCoordinates(QualifiedCoordinates)

setAddressInfo

public void setAddressInfo(AddressInfo addressInfo)
Sets the AddressInfo of the landmark.

Parameters:
addressInfo - the AddressInfo of the landmark
See Also:
getAddressInfo()

setDescription

public void setDescription(String description)
Sets the description of the landmark.

Parameters:
description - description for the landmark, null may be passed in to indicate that description is not available.
See Also:
getDescription()

setName

public void setName(String name)
             throws NullPointerException
Sets the name of the landmark.

Parameters:
name - name for the landmark
Throws:
NullPointerException - if the parameter is null
See Also:
getName()

setQualifiedCoordinates

public void setQualifiedCoordinates(QualifiedCoordinates coordinates)
Sets the QualifiedCoordinates of the landmark.

Parameters:
coordinates - the qualified coordinates of the landmark
See Also:
getQualifiedCoordinates()