Class SurfaceMaskLine.MaskPointList
java.lang.Object
cz.fidentis.analyst.data.surfacemask.SurfaceMaskLine.MaskPointList
- Enclosing interface:
SurfaceMaskLine
Class representing the mask by a set of points connected by edges.
One direction linked list, with added size to make iteration over the points simpler
Additionally the last and the first points can be connected, closing the mask.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
adds a new point to the endvoid
deletePoint
(SurfaceMaskLine.MaskPoint previous, SurfaceMaskLine.MaskPoint delete) deletes a selected pointgetFirst()
gets the first pointgetLast()
gets the last pointint
getSize()
void
insertBehind
(SurfaceMaskLine.MaskPoint first, SurfaceMaskLine.MaskPoint middle) Inserts a new point behind an existing point with a successor.boolean
a mask is closeable if there is more than 2 pointsboolean
isClosed()
Checks if the mask has been closed.boolean
isEmpty()
Checks if the mask is emptyvoid
sets the first pointvoid
sets the last pointtoString()
Gets a string representation of the list
-
Constructor Details
-
MaskPointList
public MaskPointList()
-
-
Method Details
-
isCloseable
public boolean isCloseable()a mask is closeable if there is more than 2 points- Returns:
- true if closeable, else false
-
isEmpty
public boolean isEmpty()Checks if the mask is empty- Returns:
- true if empty, else false
-
isClosed
public boolean isClosed()Checks if the mask has been closed. The mask has been closed if its not empty, is closeable and last point is connected to the first.- Returns:
- true if closed else false
-
getFirst
gets the first point- Returns:
- first point
-
setFirst
sets the first point- Parameters:
first
- point to set
-
getLast
gets the last point- Returns:
- the last point
-
setLast
sets the last point- Parameters:
last
- point to set
-
getSize
public int getSize() -
addPoint
adds a new point to the end- Parameters:
point
- to add
-
insertBehind
Inserts a new point behind an existing point with a successor. The inserted point will be the new successor.- Parameters:
first
- point to insert behindmiddle
- point to insert
-
deletePoint
deletes a selected point- Parameters:
previous
- predecessor of the point to be deleteddelete
- point to delete
-
toString
Gets a string representation of the list
-