Package com.google.common.geometry
Class S2RegionIntersection
java.lang.Object
com.google.common.geometry.S2RegionIntersection
- All Implemented Interfaces:
S2Region,Serializable
@GwtCompatible(serializable=true)
public class S2RegionIntersection
extends Object
implements S2Region, Serializable
An S2RegionIntersection represents an intersection of overlapping regions. It is convenient for
computing a covering of the intersection of a set of regions. The regions are assumed to be
immutable. Note: An intersection of no regions covers the entire sphere.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionS2RegionIntersection(Collection<S2Region> regions) Create an intersection from a copy ofregions. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if all the regions fully contain the cell.booleanReturns true if all the regions fully contain the point.booleanReturns true if this S2RegionIntersection is equal to another S2RegionIntersection, where each region must be equal and in the same order.Return a bounding spherical cap.Return a bounding latitude-longitude rectangle.inthashCode()booleanmayIntersect(S2Cell cell) Returns true if the cell may intersect all regions in this collection.
-
Field Details
-
regions
-
cachedRectBound
-
-
Constructor Details
-
S2RegionIntersection
Create an intersection from a copy ofregions.
-
-
Method Details
-
contains
Returns true if all the regions fully contain the cell. -
contains
Returns true if all the regions fully contain the point. -
getCapBound
Description copied from interface:S2RegionReturn a bounding spherical cap.- Specified by:
getCapBoundin interfaceS2Region
-
getRectBound
Description copied from interface:S2RegionReturn a bounding latitude-longitude rectangle.- Specified by:
getRectBoundin interfaceS2Region
-
mayIntersect
Returns true if the cell may intersect all regions in this collection.- Specified by:
mayIntersectin interfaceS2Region
-
equals
Returns true if this S2RegionIntersection is equal to another S2RegionIntersection, 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. -
hashCode
public int hashCode()
-