org.zkoss.gmaps
Class MapModelMap

java.lang.Object
  extended by org.zkoss.gmaps.AbstractMapModel
      extended by org.zkoss.gmaps.MapModelMap
All Implemented Interfaces:
java.io.Serializable, MapModel

public class MapModelMap
extends AbstractMapModel

This is the MapModel as a Map to be used with Maps component such as Gmaps. Add or remove the contents of this model as a List would cause the associated Maps to change accordingly.

Since:
2.0_9
Author:
henrichen
See Also:
MapModel, MapModelSet, MapModelList, Serialized Form

Field Summary
protected  java.util.Map _map
           
 
Constructor Summary
MapModelMap()
          Constructor.
MapModelMap(int initialCapacity)
          Constructor.
MapModelMap(int initialCapacity, float loadFactor)
          Constructor.
MapModelMap(java.util.Map map)
          Constructor.
MapModelMap(java.util.Map map, boolean live)
          Constructor.
 
Method Summary
 void clear()
          Clear all items of this model.
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(java.lang.Object key)
           
 java.util.Map getInnerMap()
          Get the inner real Map.
 java.util.Collection getItemsIn(double swlat, double swlng, double nelat, double nelng, double cenlat, double cenlng, int zoom)
          Returns the items in the specified bounds (south-west to north-east), center latitude, center longitude, and zoom level.
 int hashCode()
           
 boolean isEmpty()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object o)
           
 void putAll(java.util.Map c)
           
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 java.lang.String toString()
           
 java.util.Collection values()
           
 
Methods inherited from class org.zkoss.gmaps.AbstractMapModel
addMapDataListener, fireEvent, removeMapDataListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_map

protected java.util.Map _map
Constructor Detail

MapModelMap

public MapModelMap(java.util.Map map,
                   boolean live)
Constructor.

Parameters:
map - the map to represent
live - whether to have a 'live' ListModel on top of the specified map. If false, the content of the specified map is copied. If true, this object is a 'facade' of the specified map, i.e., when you add or remove items from this ListModelMap, the inner "live" map would be changed accordingly. However, it is not a good idea to modify map if it is passed to this method with live is true, since Gmaps is not smart enough to handle it. Instead, modify it thru this object.
Since:
2.4.0

MapModelMap

public MapModelMap()
Constructor.


MapModelMap

public MapModelMap(java.util.Map map)
Constructor. It mades a copy of the specified map (i.e., not live).


MapModelMap

public MapModelMap(int initialCapacity)
Constructor.

Parameters:
initialCapacity - the initial capacity for this MapModelMap.

MapModelMap

public MapModelMap(int initialCapacity,
                   float loadFactor)
Constructor.

Parameters:
initialCapacity - the initial capacity for this MapModelMap.
loadFactor - the loadFactor to increase capacity of this MapModelMap.
Method Detail

getInnerMap

public java.util.Map getInnerMap()
Get the inner real Map.


clear

public void clear()
Description copied from interface: MapModel
Clear all items of this model.


getItemsIn

public java.util.Collection getItemsIn(double swlat,
                                       double swlng,
                                       double nelat,
                                       double nelng,
                                       double cenlat,
                                       double cenlng,
                                       int zoom)
Description copied from interface: MapModel
Returns the items in the specified bounds (south-west to north-east), center latitude, center longitude, and zoom level.

Parameters:
swlat - south-west latitude
swlng - south-west longitude
nelat - north-east latitude
nelng - north-east longitude
cenlat - center latitude
cenlng - center longitude
zoom - current zoom level
Returns:
the items in the specified bounds (south-west to north-east) center latitude, center longitude, and zoom level.

containsKey

public boolean containsKey(java.lang.Object key)

containsValue

public boolean containsValue(java.lang.Object value)

entrySet

public java.util.Set entrySet()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

get

public java.lang.Object get(java.lang.Object key)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isEmpty

public boolean isEmpty()

keySet

public java.util.Set keySet()

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object o)

putAll

public void putAll(java.util.Map c)

remove

public java.lang.Object remove(java.lang.Object key)

size

public int size()

values

public java.util.Collection values()


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.