Class ScreenBasedAlgorithmAdapter<T extends ClusterItem>
- java.lang.Object
-
- com.google.maps.android.clustering.algo.AbstractAlgorithm<T>
-
- com.google.maps.android.clustering.algo.ScreenBasedAlgorithmAdapter<T>
-
- All Implemented Interfaces:
Algorithm<T>,ScreenBasedAlgorithm<T>
public class ScreenBasedAlgorithmAdapter<T extends ClusterItem> extends AbstractAlgorithm<T> implements ScreenBasedAlgorithm<T>
-
-
Constructor Summary
Constructors Constructor Description ScreenBasedAlgorithmAdapter(Algorithm<T> algorithm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddItem(T item)Adds an item to the algorithmbooleanaddItems(java.util.Collection<T> items)Adds a collection of items to the algorithmvoidclearItems()java.util.Set<? extends Cluster<T>>getClusters(float zoom)java.util.Collection<T>getItems()intgetMaxDistanceBetweenClusteredItems()voidonCameraChange(com.google.android.gms.maps.model.CameraPosition cameraPosition)booleanremoveItem(T item)Removes an item from the algorithmbooleanremoveItems(java.util.Collection<T> items)Removes a collection of items from the algorithmvoidsetMaxDistanceBetweenClusteredItems(int maxDistance)booleanshouldReclusterOnMapMovement()booleanupdateItem(T item)Updates the provided item in the algorithm-
Methods inherited from class com.google.maps.android.clustering.algo.AbstractAlgorithm
lock, unlock
-
-
-
-
Method Detail
-
shouldReclusterOnMapMovement
public boolean shouldReclusterOnMapMovement()
- Specified by:
shouldReclusterOnMapMovementin interfaceScreenBasedAlgorithm<T extends ClusterItem>
-
addItem
public boolean addItem(T item)
Description copied from interface:AlgorithmAdds an item to the algorithm- Specified by:
addItemin interfaceAlgorithm<T extends ClusterItem>- Parameters:
item- the item to be added- Returns:
- true if the algorithm contents changed as a result of the call
-
addItems
public boolean addItems(java.util.Collection<T> items)
Description copied from interface:AlgorithmAdds a collection of items to the algorithm- Specified by:
addItemsin interfaceAlgorithm<T extends ClusterItem>- Parameters:
items- the items to be added- Returns:
- true if the algorithm contents changed as a result of the call
-
clearItems
public void clearItems()
- Specified by:
clearItemsin interfaceAlgorithm<T extends ClusterItem>
-
removeItem
public boolean removeItem(T item)
Description copied from interface:AlgorithmRemoves an item from the algorithm- Specified by:
removeItemin interfaceAlgorithm<T extends ClusterItem>- Parameters:
item- the item to be removed- Returns:
- true if this algorithm contained the specified element (or equivalently, if this algorithm changed as a result of the call).
-
removeItems
public boolean removeItems(java.util.Collection<T> items)
Description copied from interface:AlgorithmRemoves a collection of items from the algorithm- Specified by:
removeItemsin interfaceAlgorithm<T extends ClusterItem>- Parameters:
items- the items to be removed- Returns:
- true if this algorithm contents changed as a result of the call
-
updateItem
public boolean updateItem(T item)
Description copied from interface:AlgorithmUpdates the provided item in the algorithm- Specified by:
updateItemin interfaceAlgorithm<T extends ClusterItem>- Parameters:
item- the item to be updated- Returns:
- true if the item existed in the algorithm and was updated, or false if the item did not exist in the algorithm and the algorithm contents remain unchanged.
-
getClusters
public java.util.Set<? extends Cluster<T>> getClusters(float zoom)
- Specified by:
getClustersin interfaceAlgorithm<T extends ClusterItem>
-
getItems
public java.util.Collection<T> getItems()
- Specified by:
getItemsin interfaceAlgorithm<T extends ClusterItem>
-
setMaxDistanceBetweenClusteredItems
public void setMaxDistanceBetweenClusteredItems(int maxDistance)
- Specified by:
setMaxDistanceBetweenClusteredItemsin interfaceAlgorithm<T extends ClusterItem>
-
getMaxDistanceBetweenClusteredItems
public int getMaxDistanceBetweenClusteredItems()
- Specified by:
getMaxDistanceBetweenClusteredItemsin interfaceAlgorithm<T extends ClusterItem>
-
onCameraChange
public void onCameraChange(com.google.android.gms.maps.model.CameraPosition cameraPosition)
- Specified by:
onCameraChangein interfaceScreenBasedAlgorithm<T extends ClusterItem>
-
-