satin.aro
Class AROoutgoingData

java.lang.Object
  |
  +--satin.aro.AROoutgoingData
Direct Known Subclasses:
AROoutgoingRequest, AROoutgoingResponse

public class AROoutgoingData
extends java.lang.Object

A collection of outgoing data for an ARO request. This is the base class for AROoutgoingRequest. It contains zero or more data elements (parameters). It also serves as a compound outgoing data element for passing arrays or structures. The data elements can be named, in which case (by convention) their order is considered not significant. The data elements in any given AROoutgoingData object must be either all named or all unnamed.

Author:
Ed Stauff

Field Summary
protected int dataCount
          Number of data elements.
protected boolean finished
          Has finish been called?
protected java.lang.String message
          The ARO protocol message.
protected boolean named
          Are elements named?
 
Constructor Summary
AROoutgoingData()
          Constructs an empty data object.
 
Method Summary
void addBoolean(boolean value)
          Appends a boolean data element.
void addBoolean(boolean value, java.lang.String paramName)
          Appends a boolean data element.
void addCompound(AROoutgoingData data)
          Appends a compound data element.
void addCompound(AROoutgoingData data, java.lang.String paramName)
          Appends a compound data element.
void addCompound(AROoutgoingData data, java.lang.String paramName, java.lang.String typeName)
          Appends a compound data element with a type name.
void addInteger(int value)
          Appends an integer data element.
void addInteger(int value, java.lang.String paramName)
          Appends an integer data element.
protected void addName(java.lang.String paramName)
          Helper for Add*** methods.
void addObject(AROobject value)
          Appends an ARO object data element.
void addObject(AROobjectID value)
          Appends an ARO object data element.
void addObject(AROobjectID value, java.lang.String paramName)
          Appends an ARO object data element.
void addObject(AROobject value, java.lang.String paramName)
          Appends an ARO object data element.
void addReal(double value)
          Appends a real (floating point) data element.
void addReal(double value, java.lang.String paramName)
          Appends a real (floating point) data element.
void addString(java.lang.String value)
          Appends a string data element.
void addString(java.lang.String value, java.lang.String paramName)
          Appends a string data element.
void clear()
          Removes all contained data.
void finish()
          Must be called before the object can be transmitted.
java.lang.String getMessageString()
          Returns an ARO protocol string for the object.
boolean isFinished()
          Tells whether finish has been called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

named

protected boolean named
Are elements named?

finished

protected boolean finished
Has finish been called?

dataCount

protected int dataCount
Number of data elements.

message

protected java.lang.String message
The ARO protocol message.
Constructor Detail

AROoutgoingData

public AROoutgoingData()
Constructs an empty data object.
Method Detail

clear

public void clear()
Removes all contained data. This effectively returns the object to its just-constructed state, so that a single object can be re-used.

addBoolean

public void addBoolean(boolean value,
                       java.lang.String paramName)
Appends a boolean data element.

Parameters:
value
the value of the data element.
paramName
the name of the data element, or null.

addInteger

public void addInteger(int value,
                       java.lang.String paramName)
Appends an integer data element.

Parameters:
value
the value of the data element.
paramName
the name of the data element, or null.

addReal

public void addReal(double value,
                    java.lang.String paramName)
Appends a real (floating point) data element.

Parameters:
value
the value of the data element.
paramName
the name of the data element, null.

addString

public void addString(java.lang.String value,
                      java.lang.String paramName)
Appends a string data element.

Parameters:
value
the value of the data element.
paramName
the name of the data element, null.

addObject

public void addObject(AROobjectID value,
                      java.lang.String paramName)
Appends an ARO object data element.

Parameters:
value
the value of the data element (may be null).
paramName
the name of the data element, null.

addObject

public void addObject(AROobject value,
                      java.lang.String paramName)
Appends an ARO object data element.

Parameters:
value
the value of the data element.
paramName
the name of the data element, null.

addCompound

public void addCompound(AROoutgoingData data,
                        java.lang.String paramName)
Appends a compound data element. The data is copied, rather than caching a reference to the data.

Parameters:
value
the value of the data element.
paramName
the name of the data element, null.

addCompound

public void addCompound(AROoutgoingData data,
                        java.lang.String paramName,
                        java.lang.String typeName)
Appends a compound data element with a type name. The data is copied, rather than caching a reference to the data.

Parameters:
value
the value of the data element.
paramName
the name of the data element, null.
typeName
the type name of the data element.

addBoolean

public void addBoolean(boolean value)
Appends a boolean data element.

Parameters:
value
the value of the data element.

addInteger

public void addInteger(int value)
Appends an integer data element.

Parameters:
value
the value of the data element.

addReal

public void addReal(double value)
Appends a real (floating point) data element.

Parameters:
value
the value of the data element.

addString

public void addString(java.lang.String value)
Appends a string data element.

Parameters:
value
the value of the data element.

addObject

public void addObject(AROobjectID value)
Appends an ARO object data element.

Parameters:
value
the value of the data element.

addObject

public void addObject(AROobject value)
Appends an ARO object data element.

Parameters:
value
the value of the data element.

addCompound

public void addCompound(AROoutgoingData data)
Appends a compound data element. The data is copied, rather than caching a reference to the data.

Parameters:
value
the value of the data element.

finish

public void finish()
Must be called before the object can be transmitted. May only be called once.

isFinished

public boolean isFinished()
Tells whether finish has been called.

Returns:
true if finish has been called on this object, otherwise false.

getMessageString

public java.lang.String getMessageString()
Returns an ARO protocol string for the object. Throws an assertion if finish was not called first.

addName

protected void addName(java.lang.String paramName)
Helper for Add*** methods. Adds the name (if any), and makes sure that all elements are either named or unnamed.

Parameters:
paramName
the parameter name, or null.
Revision History

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

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

3/27/01 Ed Stauff - initial review.



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