SegmentStringpublic class BasicSegmentString extends java.lang.Object implements SegmentString
Coordinates.
Intended to optimize the noding of contiguous segments by
reducing the number of allocated objects.
SegmentStrings can carry a context object, which is useful
for preserving topological or parentage information.
All noded substrings are initialized with the same context object.| Constructor | Description |
|---|---|
BasicSegmentString(Coordinate[] pts,
java.lang.Object data) |
Creates a new segment string from a list of vertices.
|
| Modifier and Type | Method | Description |
|---|---|---|
Coordinate |
getCoordinate(int i) |
|
Coordinate[] |
getCoordinates() |
|
java.lang.Object |
getData() |
Gets the user-defined data for this segment string.
|
int |
getSegmentOctant(int index) |
Gets the octant of the segment starting at vertex
index. |
boolean |
isClosed() |
|
void |
setData(java.lang.Object data) |
Sets the user-defined data for this segment string.
|
int |
size() |
|
java.lang.String |
toString() |
public BasicSegmentString(Coordinate[] pts, java.lang.Object data)
pts - the vertices of the segment stringdata - the user-defined data of this segment string (may be null)public java.lang.Object getData()
getData in interface SegmentStringpublic void setData(java.lang.Object data)
setData in interface SegmentStringdata - an Object containing user-defined datapublic int size()
size in interface SegmentStringpublic Coordinate getCoordinate(int i)
getCoordinate in interface SegmentStringpublic Coordinate[] getCoordinates()
getCoordinates in interface SegmentStringpublic boolean isClosed()
isClosed in interface SegmentStringpublic int getSegmentOctant(int index)
index.index - the index of the vertex starting the segment. Must not be
the last index in the vertex listpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018. All rights reserved.