Package com.google.common.geometry
Class S2ShapeIndexCoder.EncodedS2ShapeIndex.LazyCell
java.lang.Object
com.google.common.geometry.S2ShapeIndex.Cell
com.google.common.geometry.S2ShapeIndexCoder.EncodedS2ShapeIndex.LazyCell
- All Implemented Interfaces:
S2Iterator.Entry
,Serializable
- Enclosing class:
S2ShapeIndexCoder.EncodedS2ShapeIndex
A lazy implementation of
S2ShapeIndex.Cell
which decodes members on demand.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate S2CellId
private S2ShapeIndex.S2ClippedShape[]
private final int
The index of this cell. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclipped
(int i) Returns the clipped shape at the given index.long
id()
Returns the cell ID of this cell as a primitive.private S2ShapeIndex.S2ClippedShape[]
ReturnscachedClippedShapes
if it's already cached.int
Returns the number of clipped shapes in this cell.Methods inherited from class com.google.common.geometry.S2ShapeIndex.Cell
create, findClipped
-
Field Details
-
i
private final int iThe index of this cell. -
cachedCellId
-
cachedClippedShapes
-
-
Constructor Details
-
LazyCell
LazyCell(int i)
-
-
Method Details
-
loadClippedShapesFromCache
ReturnscachedClippedShapes
if it's already cached. Otherwise, loads the clipped shapes fromS2ShapeIndexCoder.EncodedS2ShapeIndex.encodedCells
and stores it incachedClippedShapes
. -
id
public long id()Description copied from interface:S2Iterator.Entry
Returns the cell ID of this cell as a primitive.- Specified by:
id
in interfaceS2Iterator.Entry
- Overrides:
id
in classS2ShapeIndex.Cell
-
numShapes
public int numShapes()Description copied from class:S2ShapeIndex.Cell
Returns the number of clipped shapes in this cell.- Specified by:
numShapes
in classS2ShapeIndex.Cell
-
clipped
Description copied from class:S2ShapeIndex.Cell
Returns the clipped shape at the given index.- Specified by:
clipped
in classS2ShapeIndex.Cell
- Parameters:
i
- must be at least 0 and less thanS2ShapeIndex.Cell.numShapes()
-