|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectds.ov2.util.Serializable_array
ds.ov2.util.APDU_short_array
public class APDU_short_array
APDU_Serializable
wrapper around a short array. Provides
get
and set
methods for accessing the
array. Relies on Serializable_array
for the APDU_Serializable
functionality. This is not terribly effient, but
good enough as long as this is only used for setting the sizes of
Resizable_buffer's
in the tests of the
OV-chip protocol layer.
APDU_short
array. The latter is of
course much more convenient in the to/from_byte methods.Field Summary | |
---|---|
private APDU_short[] |
a
The internal array with the data. |
Constructor Summary | |
---|---|
APDU_short_array(int[] int_array)
Convenience initializing constructor. |
|
APDU_short_array(short len)
Noninitializing constructor. |
|
APDU_short_array(short len,
int[] int_array)
Initializing constructor for the IDL compiler. |
Method Summary | |
---|---|
void |
copy(int[] int_array)
Reinitialize this array from an int array. |
protected APDU_Serializable[] |
get_array()
Return the short array a in support for abstract
Serializable_array . |
int[] |
get_int_array()
Return the contents as int array. |
short |
get(short i)
Array read access. |
boolean |
is_compatible_with(Object o)
Compatibility check for the OV-chip protocol layer. |
void |
set(short i,
short v)
Array write access. |
short |
size()
Size in bytes of this array. |
Methods inherited from class ds.ov2.util.Serializable_array |
---|
from_byte_array, get_length, to_byte_array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ds.ov2.util.APDU_Serializable |
---|
from_byte_array, to_byte_array |
Field Detail |
---|
private APDU_short[] a
Constructor Detail |
---|
public APDU_short_array(short len)
len
- length of the short array to createpublic APDU_short_array(int[] int_array)
int_array
. Asserts that all
elements of int_array
fit into a short.
Only available if JAVACARD_APPLET
is undefined.
int_array
- provides length and data for the new short array.
public APDU_short_array(short len, int[] int_array)
len
argument is redundant here, but the IDL compiler is not
smart enough to leave it out. This constructor is the same as
the convenience initializing
constructor
. It only additionally asserts that len
equals the int_array
length.
len
- length of the new arrayint_array
- data for the new arrayMethod Detail |
---|
public int[] get_int_array()
Only available if JAVACARD_APPLET
is undefined.
public void copy(int[] int_array)
int_array
equals the length of this array
and that all elements of int_array
fit into a short.
Only available if JAVACARD_APPLET
is undefined.
int_array
- new data for this array
public short get(short i)
i
- index
ArrayIndexOutOfBoundsException
- if
the index i
is invalidpublic void set(short i, short v)
i
- indexv
- new value.
ArrayIndexOutOfBoundsException
- if the index i
is invalidprotected APDU_Serializable[] get_array()
a
in support for abstract
Serializable_array
.
get_array
in class Serializable_array
public short size()
APDU_Serializable.size()
. Overriden here with a more efficient
method to compute the size.
size
in interface APDU_Serializable
size
in class Serializable_array
public boolean is_compatible_with(Object o)
APDU_Serializable.is_compatible_with
.
This object is compatible with instances of this class with the same array length.
is_compatible_with
in interface APDU_Serializable
is_compatible_with
in class Serializable_array
o
- actual argument or result
o
is an instance of APDU_short_array
with the same length
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |