Package net.sf.eBusx.geo
Class LineString
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject
-
- net.sf.eBus.messages.EField
-
- net.sf.eBusx.geo.LineString
-
- All Implemented Interfaces:
java.io.Serializable
public final class LineString extends EField
Contains two or morePosition
s used to define a "line". The reason for the quotes is the the points may form a figure which may cross itself, form a closed polygon, or define a curve. It does not have to define a straight line.- Author:
- Charles W. Rapp
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LineString.Builder
Builder class used to createLineString
instances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LineString.Builder
builder()
Returns a new line string builder instance.boolean
equals(java.lang.Object o)
Returnstrue
ifo
is a non-null Linestring
with a position array equalingthis LineString
position array.int
hashCode()
Returns hash code of contained positions.boolean
isClosed()
Returnstrue
if this line string has three or more positions and the first and last position are equal; otherwise returnsfalse
java.lang.String
toString()
Returns a single text line containing all the line string positions.
-
-
-
Field Detail
-
positions
public final Position[] positions
The multiple points defining this line string.
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a single text line containing all the line string positions.- Overrides:
toString
in classjava.lang.Object
- Returns:
- text containing line string positions.
-
equals
public boolean equals(java.lang.Object o)
Returnstrue
ifo
is a non-null Linestring
with a position array equalingthis LineString
position array. Otherwise returnsfalse
.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- comparison object.- Returns:
true
ifo
is a non-null Linestring
with a position array equalingthis LineString
position array.
-
hashCode
public int hashCode()
Returns hash code of contained positions.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- contained positions hash code.
-
isClosed
public boolean isClosed()
Returnstrue
if this line string has three or more positions and the first and last position are equal; otherwise returnsfalse
- Returns:
true
if contains > 2 positions and the first and last positions are equal.
-
builder
public static LineString.Builder builder()
Returns a new line string builder instance.- Returns:
- new line string builder instance.
-
-