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 java.lang.Object
A simple receiver for the endpoints of an edge.<>The
S2Edge
class 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.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) S2Point
a
Endpoints of this edge last set by passing this instance toS2Shape.getEdge(int, MutableEdge)
.(package private) S2Point
b
-
Constructor Summary
Constructors Constructor Description MutableEdge()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description S2Point
getEnd()
Returns the trailing point of the last edge retrieved viaS2Shape.getEdge(int, MutableEdge)
, or null if no edge has been retrieved.S2Point
getStart()
Returns the leading point of the last edge retrieved viaS2Shape.getEdge(int, MutableEdge)
, or null if no edge has been retrieved.boolean
isEndpoint(S2Point point)
Returns true iff 'point' is either endpoint of this edge.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.
-
-
-
Field Detail
-
a
S2Point a
Endpoints of this edge last set by passing this instance toS2Shape.getEdge(int, MutableEdge)
.
-
b
S2Point b
-
-
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.
-
-