Class PolylineChange
java.lang.Object
com.luciad.geometries.constraints.PolylineChange
- All Implemented Interfaces:
AutoCloseable
Describes a change that was made to a
Polyline
geometry.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addInsertedPoint
(long insertedPointIndex) Adds the index of the point that is inserted.void
addMovedPoint
(long movedPointIndex) Adds the index of the point that is moved.void
addRemovedPoint
(long removedPointIndex) Adds the index of the point that is removed.void
close()
protected void
finalize()
Returns the indices of the points in the new polyline that wereinserted
in this change.Returns the indices of the points in the new polyline that weremoved
in this change.Returns the indices of the points in the old polyline that wereremoved
in this change.Returns the translation that was applied on the polyline.boolean
hasPointInserted
(long index) Returns true if theinserted points
of this change contain the given index.boolean
hasPointMoved
(long index) Returns true if themoved points
of this change contain the given index.boolean
hasPointRemoved
(long index) Returns true if theremoved points
of this change contain the given index.void
setTranslation
(Coordinate translation) Sets the translation that was applied on the polyline.
-
Constructor Details
-
PolylineChange
public PolylineChange()Constructs an empty polyline change.
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getMovedPoints
Returns the indices of the points in the new polyline that weremoved
in this change.This only considers individual point moves, so if the whole polyline was translated, this method can still return false for individual points. For checking whether a translation took place, see
getTranslation
.- Returns:
- the indices of the points in the new polyline that were
moved
in this change.
-
getRemovedPoints
Returns the indices of the points in the old polyline that wereremoved
in this change.- Returns:
- the indices of the points in the old polyline that were
removed
in this change.
-
getInsertedPoints
Returns the indices of the points in the new polyline that wereinserted
in this change.- Returns:
- the indices of the points in the new polyline that were
inserted
in this change.
-
getTranslation
Returns the translation that was applied on the polyline.This is the result of use the method
translate
on the polyline. The value may benull
if no translation happened.- Returns:
- the translation that was applied on the polyline.
-
addMovedPoint
public void addMovedPoint(long movedPointIndex) Adds the index of the point that is moved.- Parameters:
movedPointIndex
- the index of the point in the new polyline that wasmoved
in this change.- See Also:
-
addRemovedPoint
public void addRemovedPoint(long removedPointIndex) Adds the index of the point that is removed.- Parameters:
removedPointIndex
- the index of the point in the old polyline that wasremoved
in this change.- See Also:
-
addInsertedPoint
public void addInsertedPoint(long insertedPointIndex) Adds the index of the point that is inserted.- Parameters:
insertedPointIndex
- the index of the point in the new polyline that wasinserted
in this change.- See Also:
-
setTranslation
Sets the translation that was applied on the polyline.- Parameters:
translation
- the translation that wasapplied
on the polyline in this change.- See Also:
-
hasPointMoved
public boolean hasPointMoved(long index) Returns true if themoved points
of this change contain the given index.- Parameters:
index
- the point index in the new polyline.- Returns:
- true if the
moved points
of this change contain the given index.
-
hasPointRemoved
public boolean hasPointRemoved(long index) Returns true if theremoved points
of this change contain the given index.- Parameters:
index
- the point index in the old polyline.- Returns:
- true if the
removed points
of this change contain the given index.
-
hasPointInserted
public boolean hasPointInserted(long index) Returns true if theinserted points
of this change contain the given index.- Parameters:
index
- the point index in the new polyline.- Returns:
- true if the
inserted points
of this change contain the given index.
-