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, setDefaultZOrder
copyMetaData, 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, toggleMetaData
protected 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 MapGroup
public void clearGroups()
clearGroups
in class MapGroup
public void setVisible(boolean visible)
setVisible
in class MapGroup
public void setVisibleIgnoreChildren(boolean visible)
MapGroup
setVisibleIgnoreChildren
in class MapGroup
public boolean getVisible()
getVisible
in class MapGroup
public int getGroupCount()
getGroupCount
in class MapGroup
protected boolean removeGroupImpl(MapGroup group, boolean referenceOnly)
removeGroupImpl
in class MapGroup
group
- 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 MapGroup
protected void addItemImpl(MapItem item)
addItemImpl
in class MapGroup
item
- the item to addpublic MapItem deepFindUID(java.lang.String uid)
MapGroup
deepFindUID
in class MapGroup
public MapItem deepFindItem(java.util.Map<java.lang.String,java.lang.String> metadata)
MapGroup
deepFindItem
in interface DeepMapItemQuery
deepFindItem
in class MapGroup
metadata
- 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 MapGroup
friendlyname
- the friendly name of the group to findpublic MapGroup deepFindMapGroup(java.lang.String friendlyname)
deepFindMapGroup
in class MapGroup
friendlyname
- the friendly name of the group to findpublic java.lang.String getFriendlyName()
getFriendlyName
in class MapGroup
public void setFriendlyName(java.lang.String friendlyName)
setFriendlyName
in class MapGroup
protected boolean removeItemImpl(MapItem item)
MapGroup
removeItemImpl
in class MapGroup
public java.util.Collection<MapGroup> getChildGroups()
getChildGroups
in class MapGroup
public java.util.Collection<MapGroup> getMapGroups()
public java.util.Collection<MapItem> getMapItems()
public MapGroup getChildGroupById(long id)
getChildGroupById
in class MapGroup
public MapItem getItemById(long id)
getItemById
in class MapGroup
public boolean containsItem(MapItem item)
containsItem
in class MapGroup
public boolean deepForEachItem(MapGroup.MapItemsCallback cb)
deepForEachItem
in class MapGroup
public boolean forEachItem(MapGroup.MapItemsCallback cb)
MapGroup
true
is returned by the callback.forEachItem
in class MapGroup
public MapItem findClosestItem(GeoPoint location, double threshold, java.util.Map<java.lang.String,java.lang.String> metadata)
MapGroup
findClosestItem
in class MapGroup
location
- 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)
DeepMapItemQuery
bounds
- Geodetic boundariesmetadata
- Extra query metadata