|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.io.formats.packrat.PackratDatatype
public abstract class PackratDatatype
Representation of a data type in a Packrat file. Complex types may be parameterizeable. Includes a name, so you can also think of it as like a variable declaration in a procedural language.
| Field Summary | |
|---|---|
protected PackratDatatype[] |
EMPTY_TYPE_ARRAY
|
protected int |
sizeParam
|
| Fields inherited from interface com.partnersoft.io.formats.packrat.PackratConstants |
|---|
DATATYPE_ARRAY, DATATYPE_ASSOC, DATATYPE_BLOB, DATATYPE_FLAG_COLLECTION, DATATYPE_FLAG_FIXED, DATATYPE_FLAG_STRUCT, DATATYPE_FLAG_VARIABLE, DATATYPE_FLOAT, DATATYPE_INT, DATATYPE_LIST, DATATYPE_STRING, DATATYPE_STRUCT, DATATYPE_UINT |
| Constructor Summary | |
|---|---|
PackratDatatype()
|
|
| Method Summary | |
|---|---|
void |
appendAllTypes(java.util.List results)
Adds datatypes and subdatatypes to list as text descriptions. |
abstract java.lang.Object |
bytesToObject(ByteBuffer input)
Convert the given bytes to an appropriate object representation. |
int |
getFixedSizeAmount()
Override with real fixed size in bytes if isFixedSize() is true. |
java.lang.String |
getFullDescription()
Return a full description of the declaration, including name. |
java.lang.String |
getName()
This is a presumably human-understandable name for the type declaration. |
int |
getSizeParam()
|
PackratDatatype[] |
getSubtypes()
Return a list of any subtypes. |
abstract int |
getTypeCode()
Return a single-byte code for the type. |
abstract java.lang.String |
getTypeDescription()
Return a String description of the data type (e.g. |
abstract boolean |
isFixedSize()
If true, datatype requires a fixed number of bytes. |
byte[] |
objectToByteArray(java.lang.Object input)
Convenience version of objectToBytes that makes a byte array. |
ByteBuffer |
objectToByteBuffer(java.lang.Object input)
Convenience version of objectToBytes that makes a new byte buffer. |
abstract void |
objectToBytes(java.lang.Object input,
ByteBuffer output)
Convert the given object to its binary representation. |
void |
objectToBytes(java.lang.Object input,
ByteBuffer output,
int sizeParam)
|
protected long |
readSize(ByteBuffer input,
int whereAt)
|
void |
setName(java.lang.String newName)
|
void |
setSizeParam(int newParam)
|
java.lang.String |
toString()
|
protected void |
writeSize(long size,
ByteBuffer output)
|
protected void |
writeSize(long size,
ByteBuffer output,
int whereAt)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final PackratDatatype[] EMPTY_TYPE_ARRAY
protected int sizeParam
| Constructor Detail |
|---|
public PackratDatatype()
| Method Detail |
|---|
public abstract boolean isFixedSize()
public int getFixedSizeAmount()
public abstract int getTypeCode()
public abstract java.lang.String getTypeDescription()
public abstract void objectToBytes(java.lang.Object input,
ByteBuffer output)
public void objectToBytes(java.lang.Object input,
ByteBuffer output,
int sizeParam)
public abstract java.lang.Object bytesToObject(ByteBuffer input)
public PackratDatatype[] getSubtypes()
protected final void writeSize(long size,
ByteBuffer output)
protected final void writeSize(long size,
ByteBuffer output,
int whereAt)
protected final long readSize(ByteBuffer input,
int whereAt)
public java.lang.String getFullDescription()
public java.lang.String toString()
toString in class java.lang.Objectpublic byte[] objectToByteArray(java.lang.Object input)
public ByteBuffer objectToByteBuffer(java.lang.Object input)
public void appendAllTypes(java.util.List results)
public java.lang.String getName()
public void setName(java.lang.String newName)
public int getSizeParam()
public void setSizeParam(int newParam)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||