public final class Chain
extends java.lang.Object
The chain also supports storing lists of Chains with a Chain --- this is used to store polygons with holes (the chain itself as the exterior boundary, the list of chains as holes). When chains are merged the corresponding lists will be merged in an arbitrary order. Nothing in this class prevents arbitrary nesting, but current usage in Buffer does not have holes within holes, and any such would symptomatic of a bug in buffer.
*** Note that the metadata add & get routines hold onto list objects and return live list objects, and that the routines may return null lists ***. This bit of bad API design is to avoid large blow-ups when lists of holes are passed and merged through multiple chain objects.
Creation of a chain returns the two endpoints (two separate objects). Each end is indexed with "0" being the coordinate closest to that end (a newly added vertex on an end becomes the new 0th coordinate for that end), and the coordinate on the opposite end being at index (size - 1).
Modifier and Type | Class and Description |
---|---|
static class |
Chain.AccurateSum
Accurately accumulate a summation.
|
static class |
Chain.CenterPoint
Abusing subclassing --- this is used to store the centers of circular arcs in Chain.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString() |
java.lang.String |
WKT()
Debugging only
|
java.lang.String |
WKTList()
Debugging only
|