|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvs.FieldDescriptor
The FieldDescriptor class describes a field position in a VmsStruct
class. The FieldDescriptor is based on the BLISS builtin structure type
of BLOCK and the FIELD declarations.
The following is a BLISS FIELD definition for a simple structure:
FIELD DCB_FIELDS =
SET
DCB_A = [ 0, 0, 32, 0 ], ! Longword field
DCB_B = [ 4, 0, 16, 0 ] ! Word field
TES;
The equivalent FieldDescriptor definition would be:
public class DCB_FIELDS
{
public static final FieldDescriptor DCB_A = new FieldDescriptor(0, 0, 32, 0);
public static final FieldDescriptor DCB_B = new FieldDescriptor(4, 0, 16, 0);
}
By using this method each field in a byte array can be addressed by
a descriptor detailing the byte offset, bit offset and bit length.
Access to fields larger than 64-bits are covered in the documentation
for the VmsStruct class.
VmsStruct| Field Summary | |
int |
index
The number of bytes offset from the beginning of the VmsStruct. |
int |
length
Length of the bit field to be extracted. |
int |
offset
The number of bits from the byte offset that the field begins. |
int |
signextend
Sign extension of the bit field being described. |
| Constructor Summary | |
FieldDescriptor(int index,
int offset,
int length,
int signextend)
Declares a single field descriptor for accessing a VmsStruct
class. |
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final int index
Valid values are positive integers greater than or equal to
0.
public final int offset
Valid values are from 0 to 63.
public final int length
Valid values are from 0 to 64.
For fields with a size greater that 64 bits, specify 0 as the
length and use the relevant put or get
method of VmsStruct.
public final int signextend
Valid values are 0 (unsigned) and 1
(signed).
| Constructor Detail |
public FieldDescriptor(int index,
int offset,
int length,
int signextend)
VmsStruct
class.
index - byte indexoffset - bit offsetlength - bit field lengthsignextend - sign extension flag.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||