public class DefaultMapGroup extends MapGroup
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultMapGroup.MetaDataMapItemFilter |
MapGroup.MapItemsCallback, MapGroup.OnFriendlyNameChangedListener, MapGroup.OnGroupListChangedListener, MapGroup.OnItemCallback<T extends MapItem>, MapGroup.OnItemListChangedListener, MapGroup.OnVisibleChangedListener| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
_friendlyName |
protected java.util.Map<java.lang.Long,MapGroup> |
_groups |
protected java.util.Map<java.lang.Long,MapItem> |
_items |
protected boolean |
_visible |
metadata| Constructor and Description |
|---|
DefaultMapGroup()
Create an empty MapGroup
|
DefaultMapGroup(java.lang.String friendlyName)
Create a MapGroup with a friendly display name
|
DefaultMapGroup(java.lang.String friendlyName,
java.lang.String overlay,
boolean permaGroup) |
DefaultMapGroup(java.lang.String friendlyName,
java.lang.String overlay,
boolean permaGroup,
double zOrder) |
| Modifier and Type | Method and Description |
|---|---|
MapGroup |
addGroup()
Create and add a MapGroup
|
MapGroup |
addGroup(MapGroup group)
Add a MapGroup
|
MapGroup |
addGroup(java.lang.String friendlyName)
Create and add a MapGroup with a friendly display name
|
protected void |
addItemImpl(MapItem item)
Add an item to the group
|
void |
clearGroups() |
void |
clearItems() |
boolean |
containsItem(MapItem item) |
MapItem |
deepFindItem(java.util.Map<java.lang.String,java.lang.String> metadata)
Deep traverse the map group to find an item that matches search constraints.
|
java.util.Collection<MapItem> |
deepFindItems(GeoBounds bounds,
java.util.Map<java.lang.String,java.lang.String> metadata)
Find map items within given boundaries
|
java.util.List<MapItem> |
deepFindItems(java.util.Map<java.lang.String,java.lang.String> metadata) |
MapGroup |
deepFindMapGroup(java.lang.String friendlyname)
Finds and returns THE FIRST child map group of this map group with a friendly name that
matches 'friendlyname' in a breadth-first-search process.
|
MapItem |
deepFindUID(java.lang.String uid)
Stock implementation of searching for a UID.
|
boolean |
deepForEachItem(MapGroup.MapItemsCallback cb) |
MapItem |
findClosestItem(GeoPoint location,
double threshold,
java.util.Map<java.lang.String,java.lang.String> metadata)
Finds the closest MapItem to the specified point, that falls within the specified threshold.
|
MapItem |
findItem(java.util.Map<java.lang.String,java.lang.String> meta) |
java.util.Collection<MapItem> |
findItems(GeoBounds bounds,
java.util.Map<java.lang.String,java.lang.String> metadata) |
java.util.Collection<MapItem> |
findItems(GeoPoint location,
double radius,
java.util.Map<java.lang.String,java.lang.String> metadata) |
java.util.List<MapItem> |
findItems(java.util.Map<java.lang.String,java.lang.String> meta) |
MapGroup |
findMapGroup(java.lang.String friendlyname)
Finds and returns THE FIRST child map group of this map group with a friendly name that
matches 'friendlyname'.
|
boolean |
forEachItem(MapGroup.MapItemsCallback cb)
Executes the callback on each of this group's child items until a value of
true
is returned by the callback. |
MapGroup |
getChildGroupById(long id) |
java.util.Collection<MapGroup> |
getChildGroups() |
java.lang.String |
getFriendlyName()
Get the friendly name of the MapGroup
|
int |
getGroupCount()
Get the number of child MapGroups
|
MapItem |
getItemById(long id) |
int |
getItemCount()
Get the number of MapItems in the group
|
java.util.Collection<MapItem> |
getItems() |
java.util.Collection<MapGroup> |
getMapGroups() |
java.util.Collection<MapItem> |
getMapItems() |
boolean |
getVisible() |
protected boolean |
removeGroupImpl(MapGroup group,
boolean referenceOnly)
Remove a MapGroup if it belongs to this one ;
|
protected boolean |
removeItemImpl(MapItem item)
Implementation for removing an item from a map group.
|
void |
setFriendlyName(java.lang.String friendlyName) |
void |
setVisible(boolean visible) |
void |
setVisibleIgnoreChildren(boolean visible)
Set group visibility without modifying the visibility of
children items
|
addItem, addOnFriendlyNameChangedListener, addOnGroupListChangedListener, addOnItemListChangedListener, addOnVisibleChangedListener, createMapGroupSerialId, createMarker, deepFindClosestItem, deepFindClosestItem, deepFindClosestItem, deepFindClosestItem, deepFindClosestItem, deepFindClosestItem, deepFindGroupByNameBreadthFirst, deepFindGroupByNameDepthFirst, deepFindGroupBySerialIdBreadthFirst, deepFindGroupBySerialIdDepthFirst, deepFindItem, deepFindItems, deepFindItems, deepFindItems, deepFindItems, deepFindItemsWithMetaString, deepFindItemsWithMetaString, deepFindItemWithMetaString, deepFindItemWithMetaString, deepFindItemWithSerialId, deepHitTest, deepHitTestItems, deepMapItems, deepMapItemsCount, deepMapItemsCount, dispatchFriendlyNameChanged, dispatchGroupAdded, dispatchGroupRemoved, dispatchItemAdded, dispatchItemRemoved, dispatchVisibleChanged, findClosestItem, findClosestItem, findClosestItem, findClosestItem, findClosestItem, findItem, findItems, findItems, findItems, findItemsWithMetaString, findItemWithMetaString, findItemWithMetaString, findItemWithMetaStringImpl, findMapGroup, getItemsRecursive, getParentGroup, getPath, getSerialId, hasItemListChangedListeners, hitTest, hitTestItems, mapItems, mapItemsCount, matchItemWithMetaString, matchItemWithMetaString, matchItemWithMetaString, onAddedNoSync, onRemovedNoSync, removeGroup, removeItem, removeOnFriendlyNameChangedListener, removeOnGroupListChangedListener, removeOnItemListChangedListener, removeOnVisibleChangedListener, search, setDefaultZOrdercopyMetaData, get, getMetaBoolean, getMetaData, getMetaDouble, getMetaIntArray, getMetaInteger, getMetaLong, getMetaMap, getMetaParcelable, getMetaSerializable, getMetaString, getMetaStringArrayList, hasMetaValue, removeMetaData, setMetaBoolean, setMetaData, setMetaDataImpl, setMetaDouble, setMetaIntArray, setMetaInteger, setMetaLong, setMetaMap, setMetaParcelable, setMetaSerializable, setMetaString, setMetaStringArrayList, toggleMetaDataprotected boolean _visible
protected java.lang.String _friendlyName
protected final java.util.Map<java.lang.Long,MapItem> _items
protected final java.util.Map<java.lang.Long,MapGroup> _groups
public DefaultMapGroup()
public DefaultMapGroup(java.lang.String friendlyName)
friendlyName - the friendly display namepublic DefaultMapGroup(java.lang.String friendlyName,
java.lang.String overlay,
boolean permaGroup)
public DefaultMapGroup(java.lang.String friendlyName,
java.lang.String overlay,
boolean permaGroup,
double zOrder)
public void clearItems()
clearItems in class MapGrouppublic void clearGroups()
clearGroups in class MapGrouppublic void setVisible(boolean visible)
setVisible in class MapGrouppublic void setVisibleIgnoreChildren(boolean visible)
MapGroupsetVisibleIgnoreChildren in class MapGrouppublic boolean getVisible()
getVisible in class MapGrouppublic int getGroupCount()
getGroupCount in class MapGroupprotected boolean removeGroupImpl(MapGroup group, boolean referenceOnly)
removeGroupImpl in class MapGroupgroup - the MapGroup to removereferenceOnly - If true only references to the group should be removed.
This will be the common case when the remove is effected by adding the child to
another group. If false it is assumed that the group is being
disposed of.public MapGroup addGroup()
public MapGroup addGroup(java.lang.String friendlyName)
public int getItemCount()
getItemCount in class MapGroupprotected void addItemImpl(MapItem item)
addItemImpl in class MapGroupitem - the item to addpublic MapItem deepFindUID(java.lang.String uid)
MapGroupdeepFindUID in class MapGrouppublic MapItem deepFindItem(java.util.Map<java.lang.String,java.lang.String> metadata)
MapGroupdeepFindItem in interface DeepMapItemQuerydeepFindItem in class MapGroupmetadata - is the map looking for matches with a key and a value.public java.util.List<MapItem> deepFindItems(java.util.Map<java.lang.String,java.lang.String> metadata)
public MapItem findItem(java.util.Map<java.lang.String,java.lang.String> meta)
public java.util.List<MapItem> findItems(java.util.Map<java.lang.String,java.lang.String> meta)
public MapGroup findMapGroup(java.lang.String friendlyname)
findMapGroup in class MapGroupfriendlyname - the friendly name of the group to findpublic MapGroup deepFindMapGroup(java.lang.String friendlyname)
deepFindMapGroup in class MapGroupfriendlyname - the friendly name of the group to findpublic java.lang.String getFriendlyName()
getFriendlyName in class MapGrouppublic void setFriendlyName(java.lang.String friendlyName)
setFriendlyName in class MapGroupprotected boolean removeItemImpl(MapItem item)
MapGroupremoveItemImpl in class MapGrouppublic java.util.Collection<MapGroup> getChildGroups()
getChildGroups in class MapGrouppublic java.util.Collection<MapGroup> getMapGroups()
public java.util.Collection<MapItem> getMapItems()
public MapGroup getChildGroupById(long id)
getChildGroupById in class MapGrouppublic MapItem getItemById(long id)
getItemById in class MapGrouppublic boolean containsItem(MapItem item)
containsItem in class MapGrouppublic boolean deepForEachItem(MapGroup.MapItemsCallback cb)
deepForEachItem in class MapGrouppublic boolean forEachItem(MapGroup.MapItemsCallback cb)
MapGrouptrue
is returned by the callback.forEachItem in class MapGrouppublic MapItem findClosestItem(GeoPoint location, double threshold, java.util.Map<java.lang.String,java.lang.String> metadata)
MapGroupfindClosestItem in class MapGrouplocation - The locationthreshold - The search threshold, in meters. Only items that are within this distance
from the point are considered. If no threshold is desired, the value
0.0d should be specified.public java.util.Collection<MapItem> findItems(GeoPoint location, double radius, java.util.Map<java.lang.String,java.lang.String> metadata)
public java.util.Collection<MapItem> findItems(GeoBounds bounds, java.util.Map<java.lang.String,java.lang.String> metadata)
public java.util.Collection<MapItem> deepFindItems(GeoBounds bounds, java.util.Map<java.lang.String,java.lang.String> metadata)
DeepMapItemQuerybounds - Geodetic boundariesmetadata - Extra query metadata