Package com.google.common.geometry
Class S2Shape.MutableEdge
- java.lang.Object
-
- com.google.common.geometry.S2Shape.MutableEdge
-
- Enclosing interface:
- S2Shape
public static final class S2Shape.MutableEdge extends Object
A simple receiver for the endpoints of an edge.<>The
S2Edgeclass is not suitable for retrieving large numbers of edges, as it often triggers allocations. This class is intended to allow fast retrieval of the endpoints in a single call.
-
-
Constructor Summary
Constructors Constructor Description MutableEdge()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description S2PointgetEnd()Returns the trailing point of the last edge retrieved viaS2Shape.getEdge(int, MutableEdge), or null if no edge has been retrieved.S2PointgetStart()Returns the leading point of the last edge retrieved viaS2Shape.getEdge(int, MutableEdge), or null if no edge has been retrieved.booleanisEndpoint(S2Point point)Returns true iff 'point' is either endpoint of this edge.voidset(S2Point start, S2Point end)Called by implementations ofS2Shape.getEdge(int, MutableEdge)to update the endpoints of this mutable edge to the given values.
-
-
-
Method Detail
-
getStart
public S2Point getStart()
Returns the leading point of the last edge retrieved viaS2Shape.getEdge(int, MutableEdge), or null if no edge has been retrieved.
-
getEnd
public S2Point getEnd()
Returns the trailing point of the last edge retrieved viaS2Shape.getEdge(int, MutableEdge), or null if no edge has been retrieved.
-
isEndpoint
public boolean isEndpoint(S2Point point)
Returns true iff 'point' is either endpoint of this edge.
-
set
public void set(S2Point start, S2Point end)
Called by implementations ofS2Shape.getEdge(int, MutableEdge)to update the endpoints of this mutable edge to the given values.
-
-