|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nokia.nfc.nxp.mfstd.MFValue
public class MFValue
A class representing the contents of a Mifare Standard Card's value block. The value field is a 4 byte long signed integer and the address field is a 1 byte long unsigned integer.
Field Summary | |
---|---|
static int |
MAX_ADDRESS
The largest address field value. |
static int |
MIN_ADDRESS
The smallest address field value. |
Constructor Summary | |
---|---|
MFValue()
Creates a new MFValue object. |
|
MFValue(byte[] valueBlock)
Creates a new MFValue object by reading the value and address fields from the given byte array. |
|
MFValue(int value,
int address)
Creates a new MFValue object with specified value and address. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Tests if the given object is equal to this object. |
int |
getAddress()
Returns the value of the address field. |
int |
getValue()
Returns the value of the value field. |
void |
setAddress(int address)
Sets the value of the address field. |
void |
setValue(int value)
Sets the value of the MF valueblock. |
byte[] |
toByteArray()
Returns an array containing the value block contents. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MIN_ADDRESS
public static final int MAX_ADDRESS
Constructor Detail |
---|
public MFValue()
public MFValue(int value, int address)
value
- the value field value.address
- the address field value
java.lang.IllegalArgumentException
- if either of the parameter values is out of range.public MFValue(byte[] valueBlock)
valueBlock
- a valid value block.
java.lang.NullPointerException
- if the valueBlock
array is null
.
java.lang.IllegalArgumentException
- if the valueBlock
is not a valid value block.Method Detail |
---|
public int getAddress()
public void setAddress(int address)
MIN_ADDRESS
to MAX_ADDRESS
.
address
- the new address field value.
java.lang.IllegalArgumentException
- if the value is out of range.public int getValue()
public void setValue(int value)
java.lang.IllegalArgumentException
- if the value is out of range.public byte[] toByteArray()
MFBlock.BLOCK_LEN
.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
true
if the objects are equal and false
if not.
|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |