vs
Class FieldDescriptor

java.lang.Object
  extended byvs.FieldDescriptor

public class FieldDescriptor
extends java.lang.Object

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.

See Also:
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

index

public final int index
The number of bytes offset from the beginning of the VmsStruct.

Valid values are positive integers greater than or equal to 0.


offset

public final int offset
The number of bits from the byte offset that the field begins.

Valid values are from 0 to 63.


length

public final int length
Length of the bit field to be extracted.

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.


signextend

public final int signextend
Sign extension of the bit field being described.

Valid values are 0 (unsigned) and 1 (signed).

Constructor Detail

FieldDescriptor

public FieldDescriptor(int index,
                       int offset,
                       int length,
                       int signextend)
Declares a single field descriptor for accessing a VmsStruct class.

Parameters:
index - byte index
offset - bit offset
length - bit field length
signextend - sign extension flag.