public static class DOFArray.Type extends DOFType
DOFType.Context, DOFType.Nullable, DOFType.Typedef
Constructor and Description |
---|
Type(DOFType.Context context,
DOFPacket packet)
Construct a type from the data read from the wire.
|
Type(DOFType subtype,
int maxLength)
Construct a fixed-length array of the specified element type.
|
Type(DOFType subtype,
int minLength,
int maxLength)
Construct a variable-length array of the specified element type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Return whether two types are equal.
|
DOFValue |
getInstance(DOFPacket packet)
|
int |
getMaxLength()
Get the maximum length of the type.
|
int |
getMinLength()
Get the minimum length of the type.
|
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, getTypeID, isCompatibleWith, isDefined, marshal
public Type(DOFType subtype, int maxLength)
subtype
- The type of each element of the array. Must not be null.maxLength
- The maximum length of the array. Must be non-negative.public Type(DOFType subtype, int minLength, int maxLength)
minLength
must be less than or equal to maxLength
.subtype
- The type of each element of the array. May be null if the maxLength is 0, then the
DOFArray.VOID
type is used to create an empty array. If the array cannot be empty (minLength > 0)
then the subtype must be defined (DOFType.isDefined()
must return true
).minLength
- The minimum length of the array. Must be non-negative.maxLength
- The maximum length of the array. Must be greater than or equal to minLength
.public Type(DOFType.Context context, DOFPacket packet) throws DOFMarshalException
context
- The context for reference types.packet
- The source of the type. Must not be null.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 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 java.util.List<DOFType> getSubtypes()
DOFType
getSubtypes
in class DOFType
public int getMaxLength()
DOFType
getMaxLength
in class DOFType
public int getMinLength()
DOFType
getMinLength
in class DOFType
public int hashCode()
DOFType
DOFType.equals(java.lang.Object)
returns true
.public boolean equals(java.lang.Object other)
DOFType