java.lang.Object
com.ibm.j9ddr.corereaders.tdump.zebedee.util.TemplateField
This class represents one field of a template.
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the length in bits of this fieldintReturns the length in bytes of this fieldintReturns the offset (in bits) of the field within the template.getName()Returns the name of the fieldintReturns the offset (in bytes) of the field within the template.booleanReturns true if this is a bit field (ie the number of bits is not a multiple of 8)booleanReturns true is this field is a pointer.longreadLong(ImageInputStream inputStream, long address) Returns the field in long form.
-
Method Details
-
isBitField
public boolean isBitField()Returns true if this is a bit field (ie the number of bits is not a multiple of 8) -
byteLength
public int byteLength()Returns the length in bytes of this field -
bitLength
public int bitLength()Returns the length in bits of this field -
getName
Returns the name of the field -
readLong
Returns the field in long form. The field must be either of type "int" or of type "pointer". For integers if the native size is less than 64 bits then a widening conversion is performed.- Parameters:
inputStream- the ImageInputStream to read fromaddress- the address of the start of the template (not of the field!)- Returns:
- the field converted to a long
- Throws:
IOException- if any errors occurred on reading from the stream
-
isPointer
public boolean isPointer()Returns true is this field is a pointer. -
getOffset
public int getOffset()Returns the offset (in bytes) of the field within the template.- Returns:
- the offset of the field (rounded down for bit fields)
-
getBitOffset
public int getBitOffset()Returns the offset (in bits) of the field within the template.- Returns:
- the offset of the field
-