public abstract class LatLngWindow<T extends LatLngWindow<T>> extends Object
| Constructor and Description |
|---|
LatLngWindow() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
contains(LatLng point)
Tests to see if the given point falls within this window.
|
<E> void |
filter(Collection<E> collection,
FilterHelper<E> helper)
Goes through the given collection removing items whose LatLng
point does not fall within this window.
|
<E> void |
filterCopy(Collection<E> source,
Collection<E> destination,
FilterHelper<E> helper)
Goes through the source collection copying items whose LatLng
point falls within this window to the destination collection.
|
abstract LatLng |
getCenter()
Returns the center point of the window.
|
static double |
latitudeDeltaToLength(double deltaLat,
LengthUnit unit)
Converts a latitude degree arc to the length of that arc.
|
static double |
lengthToLatitudeDelta(double length,
LengthUnit unit)
Converts a length measurement into the latitude that that length
spans.
|
static double |
lengthToLongitudeDelta(double length,
LengthUnit unit,
double latitude)
Converts a length measurement into the longitude that that length
spans at the given latitude.
|
static double |
longitudeDeltaToLength(double deltaLng,
LengthUnit unit,
double latitude)
Converts a longitude degree arc at a specific latitude to the length
of the arc.
|
abstract boolean |
overlaps(T window)
Test if this window overlaps the given window.
|
public static double lengthToLatitudeDelta(double length,
LengthUnit unit)
length - the length of the arc.unit - the units for length.public static double latitudeDeltaToLength(double deltaLat,
LengthUnit unit)
lengthToLatitudeDelta(double, LengthUnit)deltaLat - the latitude arc degrees.unit - the desired length units.public static double lengthToLongitudeDelta(double length,
LengthUnit unit,
double latitude)
length - the length of the arc.unit - the units for length.latitude - the latitude at which this result applies.public static double longitudeDeltaToLength(double deltaLng,
LengthUnit unit,
double latitude)
lengthToLongitudeDelta(double, LengthUnit, double)deltaLng - the longitude arc degrees.unit - the desired length units.latitude - the latitude at which this arc lies.public abstract LatLng getCenter()
public abstract boolean contains(LatLng point)
point - the point to test.public abstract boolean overlaps(T window)
window - the window to test against this one.public <E> void filter(Collection<E> collection, FilterHelper<E> helper)
E - the type of elements in the collection.collection - the collection of elements.helper - the instance of FilterHelper that gives this
method access to E's LatLng value that we will test against
this window.public <E> void filterCopy(Collection<E> source, Collection<E> destination, FilterHelper<E> helper)
Goes through the source collection copying items whose LatLng point falls within this window to the destination collection. The LatLng point used in this collection traversal is accessed via the FilterHelper instance passed in.
This should save you from copying an entire collection and then filtering it when you want to leave the first collection intact. This is a shallow copy, meaning changes made to objects within the copied collection will be reflected in the original, so beware.
E - the type of elements in the collection.source - the source collection of elements.destination - the destination collection; after this method
runs, destination contains all items that fit within this window.helper - the instance of FilterHelper that gives this
method access to E's LatLng value that we will test against
this window.Copyright © 2010-2015. All Rights Reserved.