public final class PolylineChange extends Object implements AutoCloseable
Polyline
geometry.Constructor and Description |
---|
PolylineChange()
Constructs an empty polyline change.
|
Modifier and Type | Method and Description |
---|---|
void |
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() |
List<Long> |
getInsertedPoints()
Returns the indices of the points in the new polyline that were
inserted in this change. |
List<Long> |
getMovedPoints()
Returns the indices of the points in the new polyline that were
moved in this change. |
List<Long> |
getRemovedPoints()
Returns the indices of the points in the old polyline that were
removed in this change. |
Coordinate |
getTranslation()
Returns the translation that was applied on the polyline.
|
boolean |
hasPointInserted(long index)
Returns true if the
inserted points of this change contain the given index. |
boolean |
hasPointMoved(long index)
Returns true if the
moved points of this change contain the given index. |
boolean |
hasPointRemoved(long index)
Returns true if the
removed points of this change contain the given index. |
void |
setTranslation(Coordinate translation)
Sets the translation that was applied on the polyline.
|
public void close()
close
in interface AutoCloseable
@NotNull public List<Long> getMovedPoints()
moved
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
.
moved
in this change.@NotNull public List<Long> getRemovedPoints()
removed
in this change.removed
in this change.@NotNull public List<Long> getInsertedPoints()
inserted
in this change.inserted
in this change.@Nullable public Coordinate getTranslation()
This is the result of use the method translate
on the polyline. The value may be null
if no translation happened.
public void addMovedPoint(long movedPointIndex)
movedPointIndex
- the index of the point in the new polyline that was moved
in this change.getMovedPoints
public void addRemovedPoint(long removedPointIndex)
removedPointIndex
- the index of the point in the old polyline that was removed
in this change.getRemovedPoints
public void addInsertedPoint(long insertedPointIndex)
insertedPointIndex
- the index of the point in the new polyline that was inserted
in this change.getInsertedPoints
public void setTranslation(@NotNull Coordinate translation)
translation
- the translation that was applied
on the polyline in this change.getTranslation
public boolean hasPointMoved(long index)
moved points
of this change contain the given index.index
- the point index in the new polyline.moved points
of this change contain the given index.public boolean hasPointRemoved(long index)
removed points
of this change contain the given index.index
- the point index in the old polyline.removed points
of this change contain the given index.public boolean hasPointInserted(long index)
inserted points
of this change contain the given index.index
- the point index in the new polyline.inserted points
of this change contain the given index.