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 S2CellIdprivate S2ShapeIndex.S2ClippedShape[]private final intThe index of this cell. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclipped(int i) Returns the clipped shape at the given index.longid()Returns the cell ID of this cell as a primitive.private S2ShapeIndex.S2ClippedShape[]ReturnscachedClippedShapesif it's already cached.intReturns 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
ReturnscachedClippedShapesif it's already cached. Otherwise, loads the clipped shapes fromS2ShapeIndexCoder.EncodedS2ShapeIndex.encodedCellsand stores it incachedClippedShapes. -
id
public long id()Description copied from interface:S2Iterator.EntryReturns the cell ID of this cell as a primitive.- Specified by:
idin interfaceS2Iterator.Entry- Overrides:
idin classS2ShapeIndex.Cell
-
numShapes
public int numShapes()Description copied from class:S2ShapeIndex.CellReturns the number of clipped shapes in this cell.- Specified by:
numShapesin classS2ShapeIndex.Cell
-
clipped
Description copied from class:S2ShapeIndex.CellReturns the clipped shape at the given index.- Specified by:
clippedin classS2ShapeIndex.Cell- Parameters:
i- must be at least 0 and less thanS2ShapeIndex.Cell.numShapes()
-