public class IdentifierField extends Object implements IIdentifierField
IIdentifierField
.Modifier and Type | Class and Description |
---|---|
static class |
IdentifierField.ValueOutOfRangeException |
Modifier and Type | Field and Description |
---|---|
private int |
intMask |
private boolean |
isSigned |
private String |
label |
private long |
longMask |
private static int |
MAX_BITS |
private static int |
MAX_OFFSET |
private int |
maxValue |
private static int |
MIN_BITS |
private static int |
MIN_OFFSET |
private int |
minValue |
private int |
numberOfBits |
private int |
offset |
Constructor and Description |
---|
IdentifierField(String label,
int numberOfBits,
int offset,
boolean isSigned) |
Modifier and Type | Method and Description |
---|---|
int |
getIntegerMask()
Get mask on as int value.
|
String |
getLabel()
Get the string label associated with this field.
|
long |
getLongMask()
Get mask on as long value.
|
int |
getMaxValue()
Get the maximum inclusive value that can be stored in this field.
|
int |
getMinValue()
Get the minimum inclusive value that can be stored in this field.
|
int |
getNumberOfBits()
Get the number of bits in this field.
|
int |
getOffset()
Get offset, or starting position, of this field.
|
boolean |
isSigned()
True if field is capable of holding signed values.
|
boolean |
isValidValue(int value)
True if value is within valid range of field values; false if not.
|
IIdentifier |
pack(int value)
Pack a single value of this field into a
IIdentifier . |
void |
pack(int value,
IIdentifier id)
Pack a single value this field into an existing
IIdentifier ,
preserving the other field values that may be present. |
String |
toString() |
int |
unpack(IIdentifier compact)
Unpack and return the value of this field from a 64-bit
IIdentifier . |
int |
unpack(long value)
Unpack and return the value of this field from a raw long.
|
private String label
private int numberOfBits
private int offset
private boolean isSigned
private int maxValue
private int minValue
private long longMask
private int intMask
private static final int MAX_OFFSET
private static final int MIN_OFFSET
private static final int MAX_BITS
private static final int MIN_BITS
public IdentifierField(String label, int numberOfBits, int offset, boolean isSigned)
public String getLabel()
IIdentifierField
getLabel
in interface IIdentifierField
public int getNumberOfBits()
IIdentifierField
getNumberOfBits
in interface IIdentifierField
public int getOffset()
IIdentifierField
getOffset
in interface IIdentifierField
public boolean isSigned()
IIdentifierField
isSigned
in interface IIdentifierField
public int unpack(long value)
IIdentifierField
unpack
in interface IIdentifierField
public int unpack(IIdentifier compact)
IIdentifierField
IIdentifier
.unpack
in interface IIdentifierField
public IIdentifier pack(int value)
IIdentifierField
IIdentifier
.pack
in interface IIdentifierField
value
- A value to pack into this field.public void pack(int value, IIdentifier id)
IIdentifierField
IIdentifier
,
preserving the other field values that may be present.pack
in interface IIdentifierField
value
- The field value.id
- An Identifier.public int getMaxValue()
IIdentifierField
getMaxValue
in interface IIdentifierField
public int getMinValue()
IIdentifierField
getMinValue
in interface IIdentifierField
public int getIntegerMask()
IIdentifierField
getIntegerMask
in interface IIdentifierField
public long getLongMask()
IIdentifierField
getLongMask
in interface IIdentifierField
public boolean isValidValue(int value)
IIdentifierField
isValidValue
in interface IIdentifierField
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.