public static class DOFStructure.Type extends DOFType
DOFType
that matches DOFStructure
.DOFType.Context, DOFType.Nullable, DOFType.Typedef
Constructor and Description |
---|
Type(DOFType... fields)
Construct a structure type.
|
Type(DOFType.Context context,
DOFPacket packet)
Construct a type from the data read from the wire.
|
Type(java.util.List<DOFType> fields)
Construct a structure type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Return whether two types are equal.
|
DOFValue |
getInstance(DOFPacket packet)
|
java.util.List<DOFType> |
getSubtypes()
Return a list of subtypes associated with this type.
|
int |
hashCode()
Return a hash code for the type.
|
void |
marshal(DOFType.Context context,
DOFPacket packet)
Marshal, or output a binary representation of this type, into the
specified packet.
|
java.lang.String |
toString()
Returns a description of the type.
|
asBoolean, asByte, asBytes, asDate, asDOFInterfaceID, asDOFObjectID, asDouble, asFloat, asInt, asLong, asShort, asString, asULong, getCharSet, getEncoding, getMaxLength, getMinLength, getTypeID, isCompatibleWith, isDefined, marshal
public Type(DOFType... fields)
fields
- A variable number of types each representing a field. Cannot be null. Further, each field type
must not be null and must be fully defined.public Type(java.util.List<DOFType> fields)
fields
- A list of types each representing a field. Cannot be null. Further, each field type
must not be null and must be fully defined.public Type(DOFType.Context context, DOFPacket packet) throws DOFMarshalException
context
- The context for reference types.packet
- The source to read the type from.DOFMarshalException
- Any exception caused during read.public void marshal(DOFType.Context context, DOFPacket packet) throws DOFMarshalException
DOFType
context
- The context for this set of related types.packet
- The packet to write the type to.DOFMarshalException
- If the type is not supported.public java.util.List<DOFType> getSubtypes()
DOFType
getSubtypes
in class DOFType
public DOFValue getInstance(DOFPacket packet) throws DOFMarshalException
DOFType
DOFValue
instance from a DOFPacket
.
When called the current buffer location will point at the first byte of data associated with the
type. On completion, the buffer location must point at the first byte after the data, meaning the
first unread byte.getInstance
in class DOFType
packet
- The buffer which contains the serialized form of the object. Must not be null.null
if the type is nullable.DOFMarshalException
- If there are errors in the data or the buffer. This is an exception to the rule that
non-RuntimeExceptions not be thrown from a constructor.public java.lang.String toString()
DOFType
public int hashCode()
DOFType
DOFType.equals(java.lang.Object)
returns true
.public boolean equals(java.lang.Object other)
DOFType