|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is an interface that specifies the minimum requirements for "atomic" datatypes used in the dail-a-behavior project. Every element in a class needs to implement at least these functions.
The primitive types must be cloneable, so that we can make copies of them. They should also conform to the Comprable interface, so we can do things like sort them using the standard Java 1.2 collection classes. In addition, a primitive type must implement a no-args constructor, so we can create a new prototypical instance given only a class name.
In addition, there are several methods that are specific to dabp. These include getSize(), which tells us the size of the object when serialized, and toString, a standard java method used to convert data to strings for things like println.
Author Don McGregor (mcgredo@nps.navy.mil) Date: Yes, please. History
Method Summary | |
java.lang.Object |
clone()
Implementation of the Cloneable interface. |
int |
compareTo(java.lang.Object obj)
Implementation of the Comparable interface. |
boolean |
equals(java.lang.Object obj)
Returns true if the two objects are equal. |
int |
getSize()
Number of bytes this takes up when serialized in binary format. |
int |
hashCode()
Hashcode; compute a 32 bit hashcode for the object. |
void |
initializeWithBinary(byte[] pBinaryData,
int offset)
Initialize an already-existing object with binary data. |
void |
initializeWithString(java.lang.String pStringData)
Initialize the object with the string data given. |
void |
serialize(java.io.DataOutputStream pOutputStream)
Serialize data, using our own internal scheme, completely separate from that of the JDK serialization/externalizable scheme. |
java.lang.String |
toString()
A standard java method. |
Method Detail |
public int getSize()
public void serialize(java.io.DataOutputStream pOutputStream)
public java.lang.String toString()
toString
in class java.lang.Object
public void initializeWithBinary(byte[] pBinaryData, int offset)
public void initializeWithString(java.lang.String pStringData)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object obj)
public java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |