satin.aro
Class AROpoint

java.lang.Object
  |
  +--satin.aro.AROpoint

public class AROpoint
extends java.lang.Object

A simple immutable point for use in ARO requests. This class encapsulates the syntax for using points in ARO requests. A point is represented in the ARO protocol syntax as a compound datum whose ARO data type is "point", and which contains two integer elements, the first named "x" and the second named "y".

Example of Usage
AROpoint transformPoint (AROpoint p)
{
    AROoutgoingRequest req = new AROoutgoingRequest("TransformPoint");
    p.addTo(req);
    AROincomingResponse reply = server.makeRequestAndThrow(req);
    return new AROpoint(reply, 0);
}
Author:
Ed Stauff

Field Summary
final int x
          The X (horizontal) coordinate.
final int y
          The Y (vertical) coordinate.
 
Constructor Summary
AROpoint(AROcompoundDatum datum, int position)
          Constructs a point from the given data element.
AROpoint(AROcompoundDatum datum, int position, java.lang.String paramName)
          Constructs a point from the given data element.
AROpoint(int x, int y)
          Simple constructor.
 
Method Summary
void addTo(AROoutgoingData data)
          Adds a point to the given data.
static void addTo(AROoutgoingData data, int x, int y)
          Adds a point to the given data.
static void addTo(AROoutgoingData data, int x, int y, java.lang.String paramName)
          Adds a point to the given data.
void addTo(AROoutgoingData data, java.lang.String paramName)
          Adds a point to the given data.
java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public final int x
The X (horizontal) coordinate.

y

public final int y
The Y (vertical) coordinate.
Constructor Detail

AROpoint

public AROpoint(int x,
                int y)
Simple constructor.

AROpoint

public AROpoint(AROcompoundDatum datum,
                int position,
                java.lang.String paramName)
Constructs a point from the given data element. The data element of 'datum', identified by 'position' and/or 'paramName', must be a compound data element that meets the requirements described above.

Parameters:
datum
the data element to get the point from.
position
the default position of the point data element.
paramName
the name of the point data element.

AROpoint

public AROpoint(AROcompoundDatum datum,
                int position)
Constructs a point from the given data element. The data element of 'datum', identified by 'position', must be a compound data element that meets the requirements described above.

Parameters:
datum
the data element to get the point from.
position
the position of the point data element.
Method Detail

addTo

public void addTo(AROoutgoingData data,
                  java.lang.String paramName)
Adds a point to the given data.

Parameters:
data
the data to add the point to.
paramName
the parameter name for the point, or null.

addTo

public void addTo(AROoutgoingData data)
Adds a point to the given data.

Parameters:
data
the data to add the point to.

addTo

public static void addTo(AROoutgoingData data,
                         int x,
                         int y,
                         java.lang.String paramName)
Adds a point to the given data.

Parameters:
x
the x coordinate.
y
the y coordinate.
data
the data to add the point to.
paramName
the parameter name for the point, or null.

addTo

public static void addTo(AROoutgoingData data,
                         int x,
                         int y)
Adds a point to the given data.

Parameters:
x
the x coordinate.
y
the y coordinate.
data
the data to add the point to.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
Revision History

4/6/01 Ed Stauff - changes per initial code review.

4/8/01 Ed Stauff - changed 'add' to 'addTo'.

4/5/01 Ed Stauff - made changes per review.

3/27/01 Ed Stauff - initial review.



Generated on 5/9/2001 19:37 from AROpoint.java (PRIVATE SOURCES)