Class PolylineChange

java.lang.Object
com.luciad.geometries.constraints.PolylineChange
All Implemented Interfaces:
AutoCloseable

public final class PolylineChange extends Object implements AutoCloseable
Describes a change that was made to a Polyline geometry.
  • Constructor Details

    • PolylineChange

      public PolylineChange()
      Constructs an empty polyline change.
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getMovedPoints

      @NotNull public List<Long> getMovedPoints()
      Returns the indices of the points in the new polyline that were 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.

      Returns:
      the indices of the points in the new polyline that were moved in this change.
    • getRemovedPoints

      @NotNull public List<Long> getRemovedPoints()
      Returns the indices of the points in the old polyline that were removed in this change.
      Returns:
      the indices of the points in the old polyline that were removed in this change.
    • getInsertedPoints

      @NotNull public List<Long> getInsertedPoints()
      Returns the indices of the points in the new polyline that were inserted in this change.
      Returns:
      the indices of the points in the new polyline that were inserted in this change.
    • getTranslation

      @Nullable public Coordinate 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 be null 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 was moved 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 was removed 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 was inserted in this change.
      See Also:
    • setTranslation

      public void setTranslation(@NotNull Coordinate translation)
      Sets the translation that was applied on the polyline.
      Parameters:
      translation - the translation that was applied on the polyline in this change.
      See Also:
    • hasPointMoved

      public boolean hasPointMoved(long index)
      Returns true if the moved 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 the removed 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 the inserted 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.