com.micello.mapapi.data
Class AddressGeomReference

java.lang.Object
  extended by com.micello.mapapi.data.AddressGeomReference
All Implemented Interfaces:
GeomReference, PointReference

public class AddressGeomReference
extends java.lang.Object
implements GeomReference

This method implements the GeomReference interface to define a geometry using the internal address. The internal address is a list of one or more key value pairs that define a geometry in terms created by the community rather than Micello. An example of a key value pair would be "Room" and "314". If there are multiple key value pairs this refers to a hierarchical address, such as "Building 5 Room 314".

If the geometry referenced appears on multiple floors, the reference will be valid for all floors unless The level id parameter is set. An example is a multilevel store in a shopping mall. The address of all levels of the geometry is the same, in this case perhaps "Store 124".


Nested Class Summary
static class AddressGeomReference.AddressPair
          This is an address key value pair.
 
Field Summary
 
Fields inherited from interface com.micello.mapapi.data.PointReference
ADDRESS_GEOM_TYPE, ID_GEOM_TYPE, LAT_LON_POINT_TYPE, MAP_POINT_TYPE
 
Constructor Summary
AddressGeomReference(java.util.List<AddressGeomReference.AddressPair> addressList)
          This constructor creates a address geom reference based on the given list of key value paris.
AddressGeomReference(java.lang.String addressKey)
          This constructor creates a address geom reference based on the given list of key value paris.
 
Method Summary
 java.lang.String getAddressKey()
          This method returns the address key for this address reference.
static java.lang.String getAddressKey(java.util.List<AddressGeomReference.AddressPair> addressList)
          This method returns the address key for an address.
 com.micello.mapapi.data.Geometry getGeometry(DrawingLevel level)
          This method returns the geometry.
 int getLevelId()
          This method retrieves the level id, applicable if the reference applies to a specific level only.
 float[] getXY(DrawingLevel level)
          This returns the location in map coordinates for placing a marker on the geometry.
 boolean isOnLevel(DrawingLevel level)
          This method is intended for internal use.
static AddressGeomReference load(JSONArray json)
          This method loads an address geometry reference from a json object.
 void setLevelId(int levelId)
          This method can be used to set the reference as applying to a specific level only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddressGeomReference

public AddressGeomReference(java.util.List<AddressGeomReference.AddressPair> addressList)
This constructor creates a address geom reference based on the given list of key value paris.

Parameters:
addressList - The list of key value pairs

AddressGeomReference

public AddressGeomReference(java.lang.String addressKey)
This constructor creates a address geom reference based on the given list of key value paris.

Parameters:
addressKey - The address key string for this address
Method Detail

getAddressKey

public java.lang.String getAddressKey()
This method returns the address key for this address reference.


setLevelId

public void setLevelId(int levelId)
This method can be used to set the reference as applying to a specific level only.

Specified by:
setLevelId in interface GeomReference

getLevelId

public int getLevelId()
This method retrieves the level id, applicable if the reference applies to a specific level only.

Specified by:
getLevelId in interface GeomReference

getXY

public float[] getXY(DrawingLevel level)
This returns the location in map coordinates for placing a marker on the geometry. It will return null if the geometry does not have a marker location defined.

Specified by:
getXY in interface PointReference

isOnLevel

public boolean isOnLevel(DrawingLevel level)
This method is intended for internal use. It returns true if the point is on the given level.

Specified by:
isOnLevel in interface PointReference
Parameters:
level - The level on shich to check if the point resides.
Returns:
True if the point is on the level.

getGeometry

public com.micello.mapapi.data.Geometry getGeometry(DrawingLevel level)
This method returns the geometry.

Specified by:
getGeometry in interface GeomReference

getAddressKey

public static java.lang.String getAddressKey(java.util.List<AddressGeomReference.AddressPair> addressList)
This method returns the address key for an address. If this is not a valid address an empty string will be returned.


load

public static AddressGeomReference load(JSONArray json)
                                 throws java.lang.Exception
This method loads an address geometry reference from a json object.

Throws:
java.lang.Exception