T
- the class of the line segmentpublic class LineSegment<T> extends Object
Constructor and Description |
---|
LineSegment(T start,
T end)
Creates a new line segment using the two given end points.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T c)
Checks if the given coordinate is equals with either end point of this segment.
|
boolean |
equals(Object obj) |
T |
getEnd()
Returns with the end point of the segment.
|
T |
getStart()
Returns with the start point of the segment.
|
boolean |
hasCommon(LineSegment<T> ls)
Checks if this segment and the given segment has a common end point.
|
int |
hashCode() |
static <T> List<LineSegment<T>> |
lineSegmentSeries(List<T> coords)
Returns with the list of line segments which is denoted by this series of points.
|
LineSegment<T> |
next(T c)
Creates the next segment of the line segment series.
|
static <T> LineSegment<T> |
startLineSegmentSeries(T p)
Starts a series of line segments.
|
String |
toString() |
public static <T> LineSegment<T> startLineSegmentSeries(T p)
lineSegmentSeries(List)
method to convert a
list of coordinates to a list of line segments.T
- the class of the line segmentp
- the starting pointpublic static <T> List<LineSegment<T>> lineSegmentSeries(List<T> coords)
T
- the class of the line segmentcoords
- the list of pointspublic T getStart()
public T getEnd()
public LineSegment<T> next(T c)
c
- the next point of the point seriespublic boolean contains(T c)
c
- the point to be checkedpublic boolean hasCommon(LineSegment<T> ls)
ls
- the other segment to be checkedCopyright © 2014–2020, Printing in 3D. All rights reserved.