public abstract class AttributeSubject
extends java.lang.Object
Constructor and Description |
---|
AttributeSubject(AttributeSubject obj)
Copy Constructor for the AttributeSubject class.
|
AttributeSubject(int nAtts)
Constructor for the AttributeSubject class.
|
Modifier and Type | Method and Description |
---|---|
void |
Attach(SimpleObserver o)
Registers an observer to be called when this object's Notify()
method is called.
|
protected java.lang.String |
boolArrayToString(java.lang.String name,
boolean[] val,
java.lang.String indent) |
protected java.lang.String |
boolToString(java.lang.String name,
boolean val,
java.lang.String indent) |
protected java.lang.String |
boolVectorToString(java.lang.String name,
java.util.Vector val,
java.lang.String indent) |
void |
Detach(SimpleObserver o)
Removes an observer from the list of observers to be called
when this object's Notify() method is called.
|
protected java.lang.String |
doubleArrayToString(java.lang.String name,
double[] val,
java.lang.String indent) |
protected java.lang.String |
doubleToString(java.lang.String name,
double val,
java.lang.String indent) |
protected java.lang.String |
doubleVectorToString(java.lang.String name,
java.util.Vector val,
java.lang.String indent) |
protected java.lang.String |
floatArrayToString(java.lang.String name,
float[] val,
java.lang.String indent) |
protected java.lang.String |
floatToString(java.lang.String name,
float val,
java.lang.String indent) |
protected java.lang.String |
floatVectorToString(java.lang.String name,
java.util.Vector val,
java.lang.String indent) |
int |
GetAttributeId()
Gets the attribute id, which is the id used in the Xfer object
when transmitting this object to the remote process.
|
java.lang.String |
GetClassName()
Returns the name of the state object's class.
|
int |
GetNumAdditionalAttributes()
Returns the number of attributes added in this level of the state object.
|
protected java.lang.String |
intArrayToString(java.lang.String name,
int[] val,
java.lang.String indent) |
protected java.lang.String |
intToString(java.lang.String name,
int val,
java.lang.String indent) |
protected java.lang.String |
intVectorToString(java.lang.String name,
java.util.Vector val,
java.lang.String indent) |
boolean |
IsSelected(int index)
Returns whether the specified attribute is selected.
|
void |
Notify()
Notifies all observers of this object that they need to be updated.
|
int |
NumAttributes()
Returns the total number of attributes in the state object.
|
int |
NumAttributesSelected()
Returns the number of selected attributes in the state object.
|
int |
Offset()
Returns the offset into the selected table where this state object's fields begin.
|
void |
Read(CommunicationBuffer buf)
Reads the object from a communication buffer, which is usually a
socket containing input from the remote process.
|
abstract void |
ReadAtts(int index,
CommunicationBuffer buf)
Reads the specified index's data from the buffer into the object.
|
protected void |
Select(int index)
Selects the i'th attribute in the object so it will be transmitted
to the remote process when written to the communication buffer.
|
void |
SelectAll()
Selects all of the attributes in the state object so they will all be
sent to the viewer when they are transmitted.
|
void |
SetAttributeId(int id)
Sets the attribute id, which is the id used in the Xfer object
when transmitting this object to the remote process.
|
protected java.lang.String |
stringToString(java.lang.String name,
java.lang.String val,
java.lang.String indent) |
protected java.lang.String |
stringVectorToString(java.lang.String name,
java.util.Vector val,
java.lang.String indent) |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String indent) |
protected java.lang.String |
ucharArrayToString(java.lang.String name,
byte[] val,
java.lang.String indent) |
protected java.lang.String |
ucharToString(java.lang.String name,
byte val,
java.lang.String indent) |
protected java.lang.String |
ucharVectorToString(java.lang.String name,
java.util.Vector val,
java.lang.String indent) |
void |
UnSelectAll()
Unselects all of the fields in the state object.
|
void |
Write(CommunicationBuffer buf)
Writes the object to a communication buffer, which is usually a
socket headed for the remote process.
|
void |
WriteAtts(CommunicationBuffer buf)
Writes the selected fields of the object to the buffer.
|
protected boolean |
WriteSelect(int index,
CommunicationBuffer buf)
If the attribute is selected then its index is written to the
communcation buffer.
|
public AttributeSubject(int nAtts)
nAtts
- The number of attributes that make up the state object.public AttributeSubject(AttributeSubject obj)
obj
- The attribute subject to copy.public void Attach(SimpleObserver o)
o
- The observer whose Update() method will be called.public void Detach(SimpleObserver o)
o
- The observer to be removed.public java.lang.String GetClassName()
public void Notify()
public void SelectAll()
public void UnSelectAll()
public int Offset()
public int NumAttributes()
public int GetNumAdditionalAttributes()
public int NumAttributesSelected()
public boolean IsSelected(int index)
index
- The index of the attribute to check.public void SetAttributeId(int id)
id
- The new idpublic int GetAttributeId()
public void Write(CommunicationBuffer buf)
buf
- The communication buffer to which the object will be written.public void Read(CommunicationBuffer buf)
buf
- The communication buffer from which the object will be read.public void WriteAtts(CommunicationBuffer buf)
buf
- The communication buffer to which the object will be written.public abstract void ReadAtts(int index, CommunicationBuffer buf)
buf
- The communication buffer to from which the object will be read.protected void Select(int index)
index
- The index of the attribute to be selected.protected boolean WriteSelect(int index, CommunicationBuffer buf)
index
- The index of the attribute to be selected.buf
- Communication bufferprotected java.lang.String boolToString(java.lang.String name, boolean val, java.lang.String indent)
protected java.lang.String boolArrayToString(java.lang.String name, boolean[] val, java.lang.String indent)
protected java.lang.String boolVectorToString(java.lang.String name, java.util.Vector val, java.lang.String indent)
protected java.lang.String intToString(java.lang.String name, int val, java.lang.String indent)
protected java.lang.String intArrayToString(java.lang.String name, int[] val, java.lang.String indent)
protected java.lang.String intVectorToString(java.lang.String name, java.util.Vector val, java.lang.String indent)
protected java.lang.String floatToString(java.lang.String name, float val, java.lang.String indent)
protected java.lang.String floatArrayToString(java.lang.String name, float[] val, java.lang.String indent)
protected java.lang.String floatVectorToString(java.lang.String name, java.util.Vector val, java.lang.String indent)
protected java.lang.String doubleToString(java.lang.String name, double val, java.lang.String indent)
protected java.lang.String doubleArrayToString(java.lang.String name, double[] val, java.lang.String indent)
protected java.lang.String doubleVectorToString(java.lang.String name, java.util.Vector val, java.lang.String indent)
protected java.lang.String ucharToString(java.lang.String name, byte val, java.lang.String indent)
protected java.lang.String ucharArrayToString(java.lang.String name, byte[] val, java.lang.String indent)
protected java.lang.String ucharVectorToString(java.lang.String name, java.util.Vector val, java.lang.String indent)
protected java.lang.String stringToString(java.lang.String name, java.lang.String val, java.lang.String indent)
protected java.lang.String stringVectorToString(java.lang.String name, java.util.Vector val, java.lang.String indent)
public java.lang.String toString(java.lang.String indent)
public java.lang.String toString()
toString
in class java.lang.Object