-
- All Implemented Interfaces:
-
com.google.maps.android.clustering.algo.Algorithm
public class PreCachingAlgorithmDecorator<T extends ClusterItem> extends AbstractAlgorithm<T>
Optimistically fetch clusters for adjacent zoom levels, caching them as necessary.
-
-
Constructor Summary
Constructors Constructor Description PreCachingAlgorithmDecorator(Algorithm<T> algorithm)
-
Method Summary
Modifier and Type Method Description booleanaddItem(T item)Adds an item to the algorithm booleanaddItems(Collection<T> items)Adds a collection of items to the algorithm voidclearItems()booleanremoveItem(T item)Removes an item from the algorithm booleanremoveItems(Collection<T> items)Removes a collection of items from the algorithm booleanupdateItem(T item)Updates the provided item in the algorithm Set<out Cluster<T>>getClusters(float zoom)Collection<T>getItems()voidsetMaxDistanceBetweenClusteredItems(int maxDistance)intgetMaxDistanceBetweenClusteredItems()-
-
Method Detail
-
addItem
boolean addItem(T item)
Adds an item to the algorithm
- Parameters:
item- the item to be added
-
addItems
boolean addItems(Collection<T> items)
Adds a collection of items to the algorithm
- Parameters:
items- the items to be added
-
clearItems
void clearItems()
-
removeItem
boolean removeItem(T item)
Removes an item from the algorithm
- Parameters:
item- the item to be removed
-
removeItems
boolean removeItems(Collection<T> items)
Removes a collection of items from the algorithm
- Parameters:
items- the items to be removed
-
updateItem
boolean updateItem(T item)
Updates the provided item in the algorithm
- Parameters:
item- the item to be updated
-
getClusters
Set<out Cluster<T>> getClusters(float zoom)
-
getItems
Collection<T> getItems()
-
setMaxDistanceBetweenClusteredItems
void setMaxDistanceBetweenClusteredItems(int maxDistance)
-
getMaxDistanceBetweenClusteredItems
int getMaxDistanceBetweenClusteredItems()
-
-
-
-