|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.jzos.fields.BinaryAsIntField
public class BinaryAsIntField
A 1-4 byte binary Field
with int accessors.
Field Summary | |
---|---|
static int |
DEFAULT_FIELD_WIDTH
|
static int |
MAX_FIELD_WIDTH
|
static int |
SIGNED_MAX_LEN1_VAL
|
static int |
SIGNED_MAX_LEN2_VAL
|
static int |
SIGNED_MAX_LEN3_VAL
|
static int |
SIGNED_MAX_LEN4_VAL
|
static int |
SIGNED_MIN_LEN1_VAL
|
static int |
SIGNED_MIN_LEN2_VAL
|
static int |
SIGNED_MIN_LEN3_VAL
|
static int |
SIGNED_MIN_LEN4_VAL
|
static int |
UNSIGNED_MAX_LEN1_VAL
|
static int |
UNSIGNED_MAX_LEN2_VAL
|
static int |
UNSIGNED_MAX_LEN3_VAL
|
static int |
UNSIGNED_MAX_LEN4_VAL
|
Constructor Summary | |
---|---|
BinaryAsIntField(int offset)
Construct a signed instance with a field width = DEFAULT_FIELD_WIDTH = 4. |
|
BinaryAsIntField(int offset,
int length)
Construct a signed instance with a given offset and length. |
|
BinaryAsIntField(int offset,
int length,
boolean signed)
Construct an instance. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Integer anInteger,
int anInt)
Compare an Integer, possibly null, with an int for equality. |
int |
getByteLength()
Answer the length of the field described by the receiver |
int |
getInt(byte[] buffer)
Answer an int from the given byte array buffer, at the offset of this field. |
int |
getInt(byte[] buffer,
int bufOffset)
Answer an int from the given byte array buffer, at the bufOffset + offset of this field. |
int |
getOffset()
Answer the offset of this field into some array of bytes |
boolean |
isSigned()
Answer true if this field described a signed binary int, false if unsigned. |
void |
putInt(int value,
byte[] buffer)
Put a signed int into thegiven byte array buffer, at the offset of this field. |
void |
putInt(int value,
byte[] buffer,
int bufOffset)
Put a signed int into thegiven byte array buffer, at the bufOffset + offset of this field. |
void |
setOffset(int offset)
|
void |
setSigned(boolean signed)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_FIELD_WIDTH
public static final int DEFAULT_FIELD_WIDTH
public static final int SIGNED_MIN_LEN1_VAL
public static final int SIGNED_MAX_LEN1_VAL
public static final int SIGNED_MIN_LEN2_VAL
public static final int SIGNED_MAX_LEN2_VAL
public static final int SIGNED_MIN_LEN3_VAL
public static final int SIGNED_MAX_LEN3_VAL
public static final int SIGNED_MIN_LEN4_VAL
public static final int SIGNED_MAX_LEN4_VAL
public static final int UNSIGNED_MAX_LEN1_VAL
public static final int UNSIGNED_MAX_LEN2_VAL
public static final int UNSIGNED_MAX_LEN3_VAL
public static final int UNSIGNED_MAX_LEN4_VAL
Constructor Detail |
---|
public BinaryAsIntField(int offset)
offset
- int the offset in some byte array to the start of this field.public BinaryAsIntField(int offset, int length)
offset
- int the offset in some byte array to the start of this field.length
- int the size of the field in bytespublic BinaryAsIntField(int offset, int length, boolean signed)
offset
- int the offset in some byte array to the start of this field.length
- int the size of the field in bytessigned
- boolean true if the field is signed, false if unsigned.Method Detail |
---|
public int getByteLength()
getByteLength
in interface Field
public int getOffset()
getOffset
in interface Field
public void setOffset(int offset)
setOffset
in interface Field
getOffset()
public int getInt(byte[] buffer)
getInt
in interface IntAccessor
buffer
- the byte array
public int getInt(byte[] buffer, int bufOffset)
getInt
in interface IntAccessor
buffer
- the byte arraybufOffset
- the additional offset into the byte array
public void putInt(int value, byte[] buffer) throws java.lang.IllegalArgumentException
putInt
in interface IntAccessor
value
- the signed int valuebuffer
- the byte array
java.lang.IllegalArgumentException
- if the value is out of rangepublic void putInt(int value, byte[] buffer, int bufOffset) throws java.lang.IllegalArgumentException
putInt
in interface IntAccessor
value
- the signed int valuebuffer
- the byte arraybufOffset
- the additional offset into the byte array
java.lang.IllegalArgumentException
- if the value is out of rangepublic boolean isSigned()
isSigned
in interface IntAccessor
public void setSigned(boolean signed)
isSigned()
public boolean equals(java.lang.Integer anInteger, int anInt)
anInteger
- anInt
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |