net.surveyos.sourceforge.jtswarped.coordinateGeometry
Class ChangeInXAndY

java.lang.Object
  extended by net.surveyos.sourceforge.jtswarped.coordinateGeometry.ChangeInXAndY

public class ChangeInXAndY
extends java.lang.Object

Provides a convenient wrapper for two double values representing the change in the x or easting ordinates and the change in y or northing ordinates of two coordinates. This class can be used to pass this set of doubles instead using an array. Using this class instead of an array of doubles helps clarify the intent of the parameter to a method. This class also provides getters and setters for the change-in-x and change-in-y values.


Constructor Summary
ChangeInXAndY()
          Creates a default ChangeInXandY object whose change-in-X component and change-in-Y component are both zero (0).
ChangeInXAndY(com.vividsolutions.jts.geom.Coordinate argFirst, com.vividsolutions.jts.geom.Coordinate argSecond)
          Creates a ChangeInXAndY object from the two Coordinate objects provided as arguments.
ChangeInXAndY(double[] argChanges)
          Constructs a ChangeInXAndY from the array of doubles.
ChangeInXAndY(double argChangeInX, double argChangeInY)
          Constructs a ChangeInXAndY using the two double values passed as arguments to the method.
ChangeInXAndY(com.vividsolutions.jts.geom.LineSegment argSegment)
          Constructs a ChangeInXAndY object from the end points of the LineSegment.
ChangeInXAndY(com.vividsolutions.jts.geom.LineString argTarget)
          Constructs a ChangeInXAndY object from a LineString object.
 
Method Summary
 double getChangeInX()
           
 double getChangeInY()
           
 void setChangeInX(double argChange)
           
 void setChangeInY(double argChange)
           
 void swapValues()
          Swaps the change-in-X and change-in-Y component values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeInXAndY

public ChangeInXAndY(double argChangeInX,
                     double argChangeInY)
Constructs a ChangeInXAndY using the two double values passed as arguments to the method. The first value is used to set the change-in-x. The second value is used to set the change-in-y.

Example of Use:

In this example we want to create a ChangeInXAndY class with a change-in-x value equal to 5000.00 and a ChangeInY value equal to 10000.00. ChangeInXAndY change = new ChangeInXAndY(5000.00, 10000.00);


ChangeInXAndY

public ChangeInXAndY(double[] argChanges)
Constructs a ChangeInXAndY from the array of doubles. The array should contain two (2) doubles. The first element should represent the change-in-X component. The second element should represent the change-in-Y component.


ChangeInXAndY

public ChangeInXAndY()
Creates a default ChangeInXandY object whose change-in-X component and change-in-Y component are both zero (0).


ChangeInXAndY

public ChangeInXAndY(com.vividsolutions.jts.geom.Coordinate argFirst,
                     com.vividsolutions.jts.geom.Coordinate argSecond)
Creates a ChangeInXAndY object from the two Coordinate objects provided as arguments. The change-in-Y and change-in-X components are calculated by subtracting the ordinate values of the second Coordinate argument from the first Coordinate argument.


ChangeInXAndY

public ChangeInXAndY(com.vividsolutions.jts.geom.LineSegment argSegment)
Constructs a ChangeInXAndY object from the end points of the LineSegment.


ChangeInXAndY

public ChangeInXAndY(com.vividsolutions.jts.geom.LineString argTarget)
Constructs a ChangeInXAndY object from a LineString object. The first and last coordinates of the LineString are used in the calculation to create the ChangeInXAndY object.

Method Detail

setChangeInX

public void setChangeInX(double argChange)

setChangeInY

public void setChangeInY(double argChange)

getChangeInX

public double getChangeInX()

getChangeInY

public double getChangeInY()

swapValues

public void swapValues()
Swaps the change-in-X and change-in-Y component values.