satin.aro
Class AROrectangle

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

public class AROrectangle
extends java.lang.Object

A simple immutable rectangle for use in ARO requests. This class encapsulates the syntax for using rectangles in ARO requests. A rectangle is represented in the ARO protocol syntax as a compound datum whose ARO data type is "rect", and which contains four integer elements named, in order, "left", "top", "right", and "bottom". It defines a rectangle, orthogonal to its coordinate space, defined by the points (left, top), (right, top), (left, bottom), and (right, bottom).

Example of Usage
AROrectangle transformRect (AROrectangle r)
{
    AROoutgoingRequest req = new AROoutgoingRequest("TransformRect");
    r.addTo(req);
    AROincomingResponse reply = server.makeRequestAndThrow(req);
    return new AROrectangle(reply, 0);
}
Author:
Ed Stauff

Field Summary
final int bottom
          Always >= top.
final int left
          Always <= right.
final int right
          Always >= left.
final int top
          Always <= bottom.
 
Constructor Summary
AROrectangle(AROcompoundDatum datum, int position)
          Constructs a rectangle from the given data element.
AROrectangle(AROcompoundDatum datum, int position, java.lang.String paramName)
          Constructs a rectangle from the given data element.
 
Method Summary
void addTo(AROoutgoingData data)
          Adds a rectangle to the given data.
static void addTo(AROoutgoingData data, int left, int top, int right, int bottom)
          Adds a rectangle to the given data.
static void addTo(AROoutgoingData data, int left, int top, int right, int bottom, java.lang.String paramName)
          Adds a rectangle to the given data.
void addTo(AROoutgoingData data, java.lang.String paramName)
          Adds a rectangle 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

left

public final int left
Always <= right.

top

public final int top
Always <= bottom.

right

public final int right
Always >= left.

bottom

public final int bottom
Always >= top.
Constructor Detail

AROrectangle

public AROrectangle(AROcompoundDatum datum,
                    int position,
                    java.lang.String paramName)
Constructs a rectangle from the given data element.

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

AROrectangle

public AROrectangle(AROcompoundDatum datum,
                    int position)
Constructs a rectangle from the given data element.

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

addTo

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

Parameters:
data
the data to add the rectangle to.

addTo

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

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

addTo

public static void addTo(AROoutgoingData data,
                         int left,
                         int top,
                         int right,
                         int bottom,
                         java.lang.String paramName)
Adds a rectangle to the given data.

Parameters:
left
the left x-coordinate.
top
the top y-coordinate.
right
the right x-coordinate.
bottom
the bottom y-coordinate.
data
the data to add the rectangle to.
paramName
the parameter name for the rectangle, or null.

addTo

public static void addTo(AROoutgoingData data,
                         int left,
                         int top,
                         int right,
                         int bottom)
Adds a rectangle to the given data.

Parameters:
left
the left x-coordinate.
top
the top y-coordinate.
right
the right x-coordinate.
bottom
the bottom y-coordinate.
data
the data to add the rectangle 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 AROrectangle.java (PRIVATE SOURCES)