public class BasicSegmentString extends Object implements SegmentString
SegmentString
s can carry a context object, which is useful
for preserving topological or parentage information.
If adding nodes is required use NodedSegmentString
.
NodedSegmentString
Constructor and Description |
---|
BasicSegmentString(Coordinate[] pts,
Object data)
Creates a new segment string from a list of vertices.
|
Modifier and Type | Method and Description |
---|---|
Coordinate |
getCoordinate(int i)
Gets the segment string coordinate at a given index.
|
Coordinate[] |
getCoordinates()
Gets the coordinates in this segment string.
|
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()
Tests if a segment string is a closed ring.
|
void |
setData(Object data)
Sets the user-defined data for this segment string.
|
int |
size()
Gets the number of coordinates in this segment string.
|
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
nextInRing, prevInRing
public BasicSegmentString(Coordinate[] pts, Object data)
pts
- the vertices of the segment stringdata
- the user-defined data of this segment string (may be null)public Object getData()
getData
in interface SegmentString
public void setData(Object data)
setData
in interface SegmentString
data
- an Object containing user-defined datapublic int size()
SegmentString
size
in interface SegmentString
public Coordinate getCoordinate(int i)
SegmentString
getCoordinate
in interface SegmentString
i
- the coordinate indexpublic Coordinate[] getCoordinates()
SegmentString
getCoordinates
in interface SegmentString
public boolean isClosed()
SegmentString
isClosed
in interface SegmentString
public int getSegmentOctant(int index)
index
.index
- the index of the vertex starting the segment. Must not be
the last index in the vertex listCopyright © 2024. All rights reserved.