public class SafeArray extends JacobObject
Constructor and Description |
---|
SafeArray()
Constructor.
|
SafeArray(int vt)
Constructor.
|
SafeArray(int vt,
int celems)
Constructor for a single dimensional array whose lower bounds is 0 and
whose upper bound is specified as a parameter
|
SafeArray(int vt,
int[] lbounds,
int[] celems)
Constructor with support for N-dimensional array support
|
SafeArray(int vt,
int celems1,
int celems2)
Creates a two dimensional SafeArray whose base indexes are 0.
|
SafeArray(java.lang.String s)
Convert a string to a VT_UI1 array.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asString()
Convert a VT_UI1 array to string.
|
java.lang.Object |
clone() |
protected void |
finalize() |
void |
fromBooleanArray(boolean[] ja)
populate the safe array from the passed in array of data
|
void |
fromByteArray(byte[] ja)
populate the safe array from the passed in array of data
|
void |
fromCharArray(char[] ja)
populate the safe array from the passed in array of data
|
void |
fromDoubleArray(double[] ja)
populate the safe array from the passed in array of data
|
void |
fromFloatArray(float[] ja)
populate the safe array from the passed in array of data
|
void |
fromIntArray(int[] ja)
populate the safe array from the passed in array of data
|
void |
fromLongArray(long[] ja)
populate the safe array from the passed in array of data
|
void |
fromShortArray(short[] ja)
populate the safe array from the passed in array of data
|
void |
fromStringArray(java.lang.String[] ja)
populate the safe array from the passed in array of data
|
void |
fromVariantArray(Variant[] ja)
populate the safe array from the passed in array of data
|
boolean |
getBoolean(int sa_idx)
boolean access
|
boolean |
getBoolean(int[] indices)
get boolean value from N-dimensional array
|
boolean |
getBoolean(int sa_idx1,
int sa_idx2)
boolean access
|
void |
getBooleans(int sa_idx,
int nelems,
boolean[] ja,
int ja_start)
boolean access
|
byte |
getByte(int sa_idx)
byte access
|
byte |
getByte(int[] indices)
get byte value from N-dimensional array
|
byte |
getByte(int sa_idx1,
int sa_idx2)
byte access
|
void |
getBytes(int sa_idx,
int nelems,
byte[] ja,
int ja_start)
Fills byte array from contents of this array
|
char |
getChar(int sa_idx)
char access
|
char |
getChar(int[] indices)
get char value from N-dimensional array
|
char |
getChar(int sa_idx1,
int sa_idx2)
char access
|
void |
getChars(int sa_idx,
int nelems,
char[] ja,
int ja_start)
char access
|
double |
getDate(int sa_idx)
get windows time from an single dimensional array
|
double |
getDouble(int sa_idx)
double access
|
double |
getDouble(int[] indices)
get double value from N-dimensional array
|
double |
getDouble(int sa_idx1,
int sa_idx2)
double access
|
void |
getDoubles(int sa_idx,
int nelems,
double[] ja,
int ja_start)
double access
|
int |
getElemSize() |
int |
getFeatures() |
float |
getFloat(int sa_idx)
float access
|
float |
getFloat(int[] indices)
get float value from N-dimensional array
|
float |
getFloat(int sa_idx1,
int sa_idx2)
float access
|
void |
getFloats(int sa_idx,
int nelems,
float[] ja,
int ja_start)
float access
|
int |
getInt(int sa_idx)
get int from an single dimensional array
|
int |
getInt(int[] indices)
get int value from N-dimensional array
|
int |
getInt(int sa_idx1,
int sa_idx2)
get int from 2 dimensional array
|
void |
getInts(int sa_idx,
int nelems,
int[] ja,
int ja_start)
retrieves a group of ints from a single dimensional array
|
java.util.Date |
getJavaDate(int sa_idx1)
returns the Java Date contained in this array
|
int |
getLBound() |
int |
getLBound(int dim) |
long |
getLong(int sa_idx)
get int from an single dimensional array
|
long |
getLong(int[] indices)
get long value from N-dimensional array
|
long |
getLong(int sa_idx1,
int sa_idx2)
get long from 2 dimensional array
|
void |
getLongs(int sa_idx,
int nelems,
long[] ja,
int ja_start)
retrieves a group of longs from a single dimensional array
|
int |
getNumDim() |
int |
getNumLocks()
not implemented.
|
short |
getShort(int sa_idx)
short access
|
short |
getShort(int[] indices)
get short value from N-dimensional array
|
short |
getShort(int sa_idx1,
int sa_idx2)
short access
|
void |
getShorts(int sa_idx,
int nelems,
short[] ja,
int ja_start)
short access
|
java.lang.String |
getString(int sa_idx)
string access
|
java.lang.String |
getString(int[] indices)
get String value from N-dimensional array
|
java.lang.String |
getString(int sa_idx1,
int sa_idx2)
string access
|
void |
getStrings(int sa_idx,
int nelems,
java.lang.String[] ja,
int ja_start)
string access
|
int |
getUBound() |
int |
getUBound(int dim) |
Variant |
getVariant(int sa_idx)
variant access
|
Variant |
getVariant(int[] indices)
get Variant value from N-dimensional array
|
Variant |
getVariant(int sa_idx1,
int sa_idx2)
variant access
|
void |
getVariants(int sa_idx,
int nelems,
Variant[] ja,
int ja_start)
variant access
|
int |
getvt() |
protected void |
init(int vt,
int[] lbounds,
int[] celems) |
void |
reinit(SafeArray sa)
Does anyone want to document this?
|
void |
reinterpretType(int vt)
Does anyone want to document this?
|
void |
safeRelease()
Finalizers call this method.
|
void |
setBoolean(int[] indices,
boolean c)
set boolean value in N-dimensional array
|
void |
setBoolean(int sa_idx,
boolean c)
boolean access
|
void |
setBoolean(int sa_idx1,
int sa_idx2,
boolean c)
boolean access
|
void |
setBooleans(int sa_idx,
int nelems,
boolean[] ja,
int ja_start)
boolean access
|
void |
setByte(int[] indices,
byte c)
set byte value in N-dimensional array
|
void |
setByte(int sa_idx,
byte c)
byte access
|
void |
setByte(int sa_idx1,
int sa_idx2,
byte c)
byte access
|
void |
setBytes(int sa_idx,
int nelems,
byte[] ja,
int ja_start)
fills array with passed in bytes
|
void |
setChar(int[] indices,
char c)
set char value in N-dimensional array
|
void |
setChar(int sa_idx,
char c)
char access
|
void |
setChar(int sa_idx1,
int sa_idx2,
char c)
char access
|
void |
setChars(int sa_idx,
int nelems,
char[] ja,
int ja_start)
char access
|
void |
setDouble(int[] indices,
double c)
set double value in N-dimensional array
|
void |
setDouble(int sa_idx,
double c)
double access
|
void |
setDouble(int sa_idx1,
int sa_idx2,
double c)
double access
|
void |
setDoubles(int sa_idx,
int nelems,
double[] ja,
int ja_start)
double access
|
void |
setFloat(int[] indices,
float c)
set float value in N-dimensional array
|
void |
setFloat(int sa_idx,
float c)
float access
|
void |
setFloat(int sa_idx1,
int sa_idx2,
float c)
float access
|
void |
setFloats(int sa_idx,
int nelems,
float[] ja,
int ja_start)
float access
|
void |
setInt(int[] indices,
int c)
set int value in N-dimensional array
|
void |
setInt(int sa_idx,
int c)
sets the int value of an element in a single dimensional array
|
void |
setInt(int sa_idx1,
int sa_idx2,
int c)
sets the int value of a 2 dimensional array
|
void |
setInts(int sa_idx,
int nelems,
int[] ja,
int ja_start)
sets a group of ints into a single dimensional array
|
void |
setLong(int[] indices,
long c)
set long value in N-dimensional array
|
void |
setLong(int sa_idx1,
int sa_idx2,
long c)
sets the long value of a 2 dimensional array
|
void |
setLong(int sa_idx,
long c)
sets the long value of an element in a single dimensional array
|
void |
setLongs(int sa_idx,
int nelems,
long[] ja,
int ja_start)
sets a group of longs into a single dimensional array
|
void |
setShort(int[] indices,
short c)
set short value in N-dimensional array
|
void |
setShort(int sa_idx1,
int sa_idx2,
short c)
short access
|
void |
setShort(int sa_idx,
short c)
short access
|
void |
setShorts(int sa_idx,
int nelems,
short[] ja,
int ja_start)
short access
|
void |
setString(int[] indices,
java.lang.String c)
set Stringvalue in N-dimensional array
|
void |
setString(int sa_idx1,
int sa_idx2,
java.lang.String c)
puts a string into an element in a two dimensional array.
|
void |
setString(int sa_idx,
java.lang.String c)
puts a string into an element in a single dimensional safe array
|
void |
setStrings(int sa_idx,
int nelems,
java.lang.String[] ja,
int ja_start)
string access
|
void |
setVariant(int[] indices,
Variant v)
set Variant value in N-dimensional array
|
void |
setVariant(int sa_idx1,
int sa_idx2,
Variant c)
variant access
|
void |
setVariant(int sa_idx,
Variant c)
variant access
|
void |
setVariants(int sa_idx,
int nelems,
Variant[] ja,
int ja_start)
variant access
|
boolean[] |
toBooleanArray()
Retrieves the data from the array cast to a Java data type
|
byte[] |
toByteArray()
Retrieves the data from the array cast to a Java data type
|
char[] |
toCharArray()
Retrieves the data from the array cast to a Java data type
|
double[] |
toDoubleArray()
Retrieves the data from the array cast to a Java data type
|
float[] |
toFloatArray()
Retrieves the data from the array cast to a Java data type
|
int[] |
toIntArray()
Retrieves the data from the array cast to a Java data type
|
long[] |
toLongArray()
Retrieves the data from the array cast to a Java data type
|
short[] |
toShortArray()
Retrieves the data from the array cast to a Java data type
|
java.lang.String |
toString()
Standard toString() Warning, this creates new Variant objects!
|
java.lang.String[] |
toStringArray()
Retrieves the data from the array cast to a Java data type
|
Variant[] |
toVariantArray()
Retrieves the data from the array cast to a Java data type
|
debug, getBuildDate, getBuildVersion, isDebugEnabled
public SafeArray()
public SafeArray(int vt)
vt
- type of arraypublic SafeArray(int vt, int celems)
vt
- type of the arraycelems
- length of the arraypublic SafeArray(int vt, int celems1, int celems2)
vt
- Type of the arraycelems1
- length of the array in first dimensioncelems2
- length of the array in second dimensionpublic SafeArray(int vt, int[] lbounds, int[] celems)
You create an N-D SafeArray by: SafeArray sa = new SafeArray(Variant.VariantVariant, new int[] {0,0,0,0}, new int[] {4,4,4,4}); Where the 1st array is lower bounds and 2nd has the lengths of each dimension *
vt
- lbounds
- celems
- public SafeArray(java.lang.String s)
s
- source stringpublic java.lang.String asString()
public java.lang.Object clone()
clone
in class java.lang.Object
protected void finalize()
finalize
in class java.lang.Object
public void fromBooleanArray(boolean[] ja)
ja
- public void fromByteArray(byte[] ja)
ja
- public void fromCharArray(char[] ja)
ja
- public void fromDoubleArray(double[] ja)
ja
- public void fromFloatArray(float[] ja)
ja
- public void fromIntArray(int[] ja)
ja
- public void fromLongArray(long[] ja)
ja
- public void fromShortArray(short[] ja)
ja
- public void fromStringArray(java.lang.String[] ja)
ja
- public void fromVariantArray(Variant[] ja)
ja
- public boolean getBoolean(int sa_idx)
sa_idx
- public boolean getBoolean(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic boolean getBoolean(int sa_idx1, int sa_idx2)
sa_idx1
- sa_idx2
- public void getBooleans(int sa_idx, int nelems, boolean[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public byte getByte(int sa_idx)
sa_idx
- public byte getByte(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic byte getByte(int sa_idx1, int sa_idx2)
sa_idx1
- sa_idx2
- public void getBytes(int sa_idx, int nelems, byte[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public char getChar(int sa_idx)
sa_idx
- public char getChar(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic char getChar(int sa_idx1, int sa_idx2)
sa_idx1
- sa_idx2
- public void getChars(int sa_idx, int nelems, char[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public double getDouble(int sa_idx)
sa_idx
- public double getDouble(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic double getDouble(int sa_idx1, int sa_idx2)
sa_idx1
- sa_idx2
- public void getDoubles(int sa_idx, int nelems, double[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public int getElemSize()
public int getFeatures()
public float getFloat(int sa_idx)
sa_idx
- public float getFloat(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic float getFloat(int sa_idx1, int sa_idx2)
sa_idx1
- sa_idx2
- public void getFloats(int sa_idx, int nelems, float[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public int getInt(int sa_idx)
sa_idx
- array indexpublic int getInt(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic int getInt(int sa_idx1, int sa_idx2)
sa_idx1
- array index first dimensionsa_idx2
- array index of second dimensionpublic void getInts(int sa_idx, int nelems, int[] ja, int ja_start)
sa_idx
- the index in the array to start the getnelems
- number of elements to retrieveja
- the structure to be filled with the intsja_start
- the start point in the java int array to start fillingpublic long getLong(int sa_idx)
sa_idx
- array indexpublic long getLong(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic long getLong(int sa_idx1, int sa_idx2)
sa_idx1
- array index first dimensionsa_idx2
- array index of second dimensionpublic void getLongs(int sa_idx, int nelems, long[] ja, int ja_start)
sa_idx
- the index in the array to start the getnelems
- number of elements to retrieveja
- the structure to be filled with the longsja_start
- the start point in the java longs array to start fillingpublic int getLBound()
public int getLBound(int dim)
dim
- the dimension we are checking in a multidimensional arraypublic int getNumDim()
public int getNumLocks()
public short getShort(int sa_idx)
sa_idx
- public short getShort(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic short getShort(int sa_idx1, int sa_idx2)
sa_idx1
- sa_idx2
- public void getShorts(int sa_idx, int nelems, short[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public java.lang.String getString(int sa_idx)
sa_idx
- public java.lang.String getString(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic java.lang.String getString(int sa_idx1, int sa_idx2)
sa_idx1
- sa_idx2
- public void getStrings(int sa_idx, int nelems, java.lang.String[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public int getUBound()
public int getUBound(int dim)
dim
- the dimension we are checking in a multidimensional arraypublic Variant getVariant(int sa_idx)
sa_idx
- public Variant getVariant(int[] indices)
indices
- - length must equal Dimension of SafeArraypublic Variant getVariant(int sa_idx1, int sa_idx2)
sa_idx1
- sa_idx2
- public void getVariants(int sa_idx, int nelems, Variant[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public int getvt()
protected void init(int vt, int[] lbounds, int[] celems)
public void reinit(SafeArray sa)
sa
- public void reinterpretType(int vt)
vt
- the variant type?public void safeRelease()
safeRelease
in class JacobObject
public void setBoolean(int sa_idx, boolean c)
sa_idx
- c
- public void setBoolean(int[] indices, boolean c)
indices
- - length must equal Dimension of SafeArrayc
- public void setBoolean(int sa_idx1, int sa_idx2, boolean c)
sa_idx1
- sa_idx2
- c
- public void setBooleans(int sa_idx, int nelems, boolean[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public void setByte(int sa_idx, byte c)
sa_idx
- c
- public void setByte(int[] indices, byte c)
indices
- - length must equal Dimension of SafeArrayc
- public void setByte(int sa_idx1, int sa_idx2, byte c)
sa_idx1
- sa_idx2
- c
- public void setBytes(int sa_idx, int nelems, byte[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public void setChar(int sa_idx, char c)
sa_idx
- c
- public void setChar(int[] indices, char c)
indices
- - length must equal Dimension of SafeArrayc
- public void setChar(int sa_idx1, int sa_idx2, char c)
sa_idx1
- sa_idx2
- c
- public void setChars(int sa_idx, int nelems, char[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public void setDouble(int sa_idx, double c)
sa_idx
- c
- public void setDouble(int[] indices, double c)
indices
- - length must equal Dimension of SafeArrayc
- public void setDouble(int sa_idx1, int sa_idx2, double c)
sa_idx1
- sa_idx2
- c
- public void setDoubles(int sa_idx, int nelems, double[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public void setFloat(int sa_idx, float c)
sa_idx
- c
- public void setFloat(int[] indices, float c)
indices
- - length must equal Dimension of SafeArrayc
- public void setFloat(int sa_idx1, int sa_idx2, float c)
sa_idx1
- sa_idx2
- c
- public void setFloats(int sa_idx, int nelems, float[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public void setInt(int sa_idx, int c)
sa_idx
- index into the arrayc
- the value to be setpublic void setInt(int[] indices, int c)
indices
- - length must equal Dimension of SafeArrayc
- public void setInt(int sa_idx1, int sa_idx2, int c)
sa_idx1
- index on the first dimensionsa_idx2
- index on the second dimensionc
- the value to be setpublic void setInts(int sa_idx, int nelems, int[] ja, int ja_start)
sa_idx
- the index of the start of the array to put intonelems
- number of elements to be copiedja
- the new int values to be put into the arrayja_start
- the start index in the array that we are copying into
SafeArraypublic void setLong(int sa_idx, long c)
sa_idx
- index into the arrayc
- the value to be setpublic void setLong(int[] indices, long c)
indices
- - length must equal Dimension of SafeArrayc
- public void setLong(int sa_idx1, int sa_idx2, long c)
sa_idx1
- index on the first dimensionsa_idx2
- index on the second dimensionc
- the value to be setpublic void setLongs(int sa_idx, int nelems, long[] ja, int ja_start)
sa_idx
- the index of the start of the array to put intonelems
- number of elements to be copiedja
- the new long values to be put into the arrayja_start
- the start index in the array that we are copying into
SafeArraypublic void setShort(int sa_idx1, int sa_idx2, short c)
sa_idx1
- sa_idx2
- c
- public void setShort(int sa_idx, short c)
sa_idx
- c
- public void setShort(int[] indices, short c)
indices
- - length must equal Dimension of SafeArrayc
- public void setShorts(int sa_idx, int nelems, short[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public void setString(int sa_idx1, int sa_idx2, java.lang.String c)
sa_idx1
- sa_idx2
- c
- public void setString(int sa_idx, java.lang.String c)
sa_idx
- c
- public void setString(int[] indices, java.lang.String c)
indices
- - length must equal Dimension of SafeArrayc
- public void setStrings(int sa_idx, int nelems, java.lang.String[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public void setVariant(int sa_idx1, int sa_idx2, Variant c)
sa_idx1
- sa_idx2
- c
- public void setVariant(int sa_idx, Variant c)
sa_idx
- c
- public void setVariant(int[] indices, Variant v)
indices
- - length must equal Dimension of SafeArrayv
- public double getDate(int sa_idx)
sa_idx
- array indexpublic java.util.Date getJavaDate(int sa_idx1)
sa_idx1
- array indexjava.lang.IllegalStateException
- if array is not of the requested typepublic void setVariants(int sa_idx, int nelems, Variant[] ja, int ja_start)
sa_idx
- nelems
- ja
- ja_start
- public boolean[] toBooleanArray()
public byte[] toByteArray()
public char[] toCharArray()
public double[] toDoubleArray()
public float[] toFloatArray()
public int[] toIntArray()
public long[] toLongArray()
public short[] toShortArray()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String[] toStringArray()
public Variant[] toVariantArray()
http://jacob-project.sourceforge.net