Class S2RegionUnion

  • All Implemented Interfaces:
    S2Region, java.io.Serializable

    @GwtCompatible(serializable=true)
    public class S2RegionUnion
    extends java.lang.Object
    implements S2Region, java.io.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​(java.util.Collection<S2Region> regions)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(S2Cell cell)
      Only returns true if one of the regions fully contains the cell.
      boolean contains​(S2Point point)
      Only returns true if one of the regions contains the point.
      boolean equals​(java.lang.Object thatObject)
      Returns true if this S2RegionUnion is equal to another S2RegionUnion, where each region must be equal and in the same order.
      S2Cap getCapBound()
      Return a bounding spherical cap.
      S2LatLngRect getRectBound()
      Return a bounding latitude-longitude rectangle.
      int hashCode()  
      boolean mayIntersect​(S2Cell cell)
      Returns true if the cell may intersect any region in this collection.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cachedCapBound

        private transient S2Cap cachedCapBound
      • cachedRectBound

        private transient S2LatLngRect cachedRectBound
    • Constructor Detail

      • S2RegionUnion

        public S2RegionUnion​(java.util.Collection<S2Region> regions)
    • Method Detail

      • contains

        public boolean contains​(S2Cell cell)
        Only returns true if one of the regions fully contains the cell.
        Specified by:
        contains in interface S2Region
      • contains

        public boolean contains​(S2Point point)
        Only returns true if one of the regions contains the point.
        Specified by:
        contains in interface S2Region
      • getCapBound

        public S2Cap getCapBound()
        Description copied from interface: S2Region
        Return a bounding spherical cap.
        Specified by:
        getCapBound in interface S2Region
      • mayIntersect

        public boolean mayIntersect​(S2Cell cell)
        Returns true if the cell may intersect any region in this collection.
        Specified by:
        mayIntersect in interface S2Region
      • equals

        public boolean equals​(java.lang.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.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object