Package com.google.common.geometry
Class S2RegionUnion
- java.lang.Object
-
- com.google.common.geometry.S2RegionUnion
-
- All Implemented Interfaces:
S2Region,Serializable
@GwtCompatible(serializable=true) public class S2RegionUnion extends Object implements S2Region, Serializable
An S2RegionUnion represents a union of possibly overlapping regions. It is convenient for computing a covering of a set of regions. The regions are assumed to be immutable.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description S2RegionUnion(Collection<S2Region> regions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(S2Cell cell)Only returns true if one of the regions fully contains the cell.booleancontains(S2Point point)Only returns true if one of the regions contains the point.booleanequals(Object thatObject)Returns true if this S2RegionUnion is equal to another S2RegionUnion, where each region must be equal and in the same order.S2CapgetCapBound()Return a bounding spherical cap.S2LatLngRectgetRectBound()Return a bounding latitude-longitude rectangle.inthashCode()booleanmayIntersect(S2Cell cell)Returns true if the cell may intersect any region in this collection.
-
-
-
Constructor Detail
-
S2RegionUnion
public S2RegionUnion(Collection<S2Region> regions)
-
-
Method Detail
-
contains
public boolean contains(S2Cell cell)
Only returns true if one of the regions fully contains the cell.
-
contains
public boolean contains(S2Point point)
Only returns true if one of the regions contains the point.
-
getCapBound
public S2Cap getCapBound()
Description copied from interface:S2RegionReturn a bounding spherical cap.- Specified by:
getCapBoundin interfaceS2Region
-
getRectBound
public S2LatLngRect getRectBound()
Description copied from interface:S2RegionReturn a bounding latitude-longitude rectangle.- Specified by:
getRectBoundin interfaceS2Region
-
mayIntersect
public boolean mayIntersect(S2Cell cell)
Returns true if the cell may intersect any region in this collection.- Specified by:
mayIntersectin interfaceS2Region
-
equals
public boolean equals(Object thatObject)
Returns true if this S2RegionUnion is equal to another S2RegionUnion, where each region must be equal and in the same order. This method is intended only for testing purposes. NOTE: This should be rewritten to disregard order if such functionality is ever required.
-
-