📄 safearray.java
字号:
* @param sa_idx2
* @return double storedin array
*/
public native double getDouble(int sa_idx1, int sa_idx2);
/**
* double access
*
* @param sa_idx
* @param c
*/
public native void setDouble(int sa_idx, double c);
/**
* double access
*
* @param sa_idx1
* @param sa_idx2
* @param c
*/
public native void setDouble(int sa_idx1, int sa_idx2, double c);
/**
* double access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void getDoubles(int sa_idx, int nelems, double ja[],
int ja_start);
/**
* double access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void setDoubles(int sa_idx, int nelems, double ja[],
int ja_start);
/**
* string access
*
* @param sa_idx
* @return String stored in array
*
*/
public native String getString(int sa_idx);
/**
* string access
*
* @param sa_idx1
* @param sa_idx2
* @return String stored in array
*/
public native String getString(int sa_idx1, int sa_idx2);
/**
* puts a string into an element in a single dimensional safe array
*
* @param sa_idx
* @param c
*/
public native void setString(int sa_idx, String c);
/**
* puts a string into an element in a two dimensional array.
*
* @param sa_idx1
* @param sa_idx2
* @param c
*/
public native void setString(int sa_idx1, int sa_idx2, String c);
/**
* string access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void getStrings(int sa_idx, int nelems, String ja[],
int ja_start);
/**
* string access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void setStrings(int sa_idx, int nelems, String ja[],
int ja_start);
/**
* byte access
*
* @param sa_idx
* @return byte representaton
*/
public native byte getByte(int sa_idx);
/**
* byte access
*
* @param sa_idx1
* @param sa_idx2
* @return byte representation
*/
public native byte getByte(int sa_idx1, int sa_idx2);
/**
* byte access
*
* @param sa_idx
* @param c
*/
public native void setByte(int sa_idx, byte c);
/**
* byte access
*
* @param sa_idx1
* @param sa_idx2
* @param c
*/
public native void setByte(int sa_idx1, int sa_idx2, byte c);
/**
* Fills byte array from contents of this array
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void getBytes(int sa_idx, int nelems, byte ja[], int ja_start);
/**
* fills array with passed in bytes
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void setBytes(int sa_idx, int nelems, byte ja[], int ja_start);
/**
* float access
*
* @param sa_idx
* @return float held in array at location
*/
public native float getFloat(int sa_idx);
/**
* float access
*
* @param sa_idx1
* @param sa_idx2
* @return float held in array at location
*/
public native float getFloat(int sa_idx1, int sa_idx2);
/**
* float access
*
* @param sa_idx
* @param c
*/
public native void setFloat(int sa_idx, float c);
/**
* float access
*
* @param sa_idx1
* @param sa_idx2
* @param c
*/
public native void setFloat(int sa_idx1, int sa_idx2, float c);
/**
* float access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void getFloats(int sa_idx, int nelems, float ja[],
int ja_start);
/**
* float access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void setFloats(int sa_idx, int nelems, float ja[],
int ja_start);
/**
* boolean access
*
* @param sa_idx
* @return boolean representation
*/
public native boolean getBoolean(int sa_idx);
/**
* boolean access
*
* @param sa_idx1
* @param sa_idx2
* @return boolean representation
*/
public native boolean getBoolean(int sa_idx1, int sa_idx2);
/**
* boolean access
*
* @param sa_idx
* @param c
*/
public native void setBoolean(int sa_idx, boolean c);
/**
* boolean access
*
* @param sa_idx1
* @param sa_idx2
* @param c
*/
public native void setBoolean(int sa_idx1, int sa_idx2, boolean c);
/**
* boolean access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void getBooleans(int sa_idx, int nelems, boolean ja[],
int ja_start);
/**
* boolean access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void setBooleans(int sa_idx, int nelems, boolean ja[],
int ja_start);
/**
* variant access
*
* @param sa_idx
* @return Variant held in locatioon in the array?
*/
public native Variant getVariant(int sa_idx);
/**
* variant access
*
* @param sa_idx1
* @param sa_idx2
* @return Variant held in a location in the array?
*/
public native Variant getVariant(int sa_idx1, int sa_idx2);
/**
* variant access
*
* @param sa_idx
* @param c
*/
public native void setVariant(int sa_idx, Variant c);
/**
* variant access
*
* @param sa_idx1
* @param sa_idx2
* @param c
*/
public native void setVariant(int sa_idx1, int sa_idx2, Variant c);
/**
* variant access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void getVariants(int sa_idx, int nelems, Variant ja[],
int ja_start);
/**
* variant access
*
* @param sa_idx
* @param nelems
* @param ja
* @param ja_start
*/
public native void setVariants(int sa_idx, int nelems, Variant ja[],
int ja_start);
/**
* Standard toString() Warning, this creates new Variant objects!
*
* @return String contents of varaint
*/
public String toString() {
String s = "";
int ndim = getNumDim();
if (ndim == 1) {
int ldim = getLBound();
int udim = getUBound();
for (int i = ldim; i <= udim; i++) {
Variant v = getVariant(i);
if (((v.getvt() & Variant.VariantTypeMask) | Variant.VariantArray) == v
.getvt()) {
return s + "[" + v.toSafeArray().toString() + "]";
} else {
s += " " + v.toString();
}
}
} else if (ndim == 2) {
int ldim1 = getLBound(1);
int udim1 = getUBound(1);
int ldim2 = getLBound(2);
int udim2 = getUBound(2);
for (int i = ldim1; i <= udim1; i++) {
for (int j = ldim2; j <= udim2; j++) {
Variant v = getVariant(i, j);
s += " " + v.toString();
}
s += "\n";
}
}
return s;
}
/*
* ================================================================ The
* beginning of N-dimensional array support
* ================================================================
*/
/**
* get Variant value from N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @return the value at the specified location
*/
public native Variant getVariant(int indices[]);
/**
* set Variant value in N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @param v
*/
public native void setVariant(int indices[], Variant v);
/**
* get char value from N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @return the value at the specified location
*/
public native char getChar(int indices[]);
/**
* set char value in N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @param c
*/
public native void setChar(int indices[], char c);
/**
* get int value from N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @return the value at the specified location
*/
public native int getInt(int indices[]);
/**
* set int value in N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @param c
*/
public native void setInt(int indices[], int c);
/**
* get short value from N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @return the value at the specified location
*/
public native short getShort(int indices[]);
/**
* set short value in N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @param c
*/
public native void setShort(int indices[], short c);
/**
* get double value from N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @return the value at the specified location
*/
public native double getDouble(int indices[]);
/**
* set double value in N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @param c
*/
public native void setDouble(int indices[], double c);
/**
* get String value from N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @return the value at the specified location
*/
public native String getString(int indices[]);
/**
* set Stringvalue in N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @param c
*/
public native void setString(int indices[], String c);
/**
* get byte value from N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @return the value at the specified location
*/
public native byte getByte(int indices[]);
/**
* set byte value in N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @param c
*/
public native void setByte(int indices[], byte c);
/**
* get float value from N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @return the value at the specified location
*/
public native float getFloat(int indices[]);
/**
* set float value in N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @param c
*/
public native void setFloat(int indices[], float c);
/**
* get boolean value from N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @return the value at the specified location
*/
public native boolean getBoolean(int indices[]);
/**
* set boolean value in N-dimensional array
*
* @param indices -
* length must equal Dimension of SafeArray
* @param c
*/
public native void setBoolean(int indices[], boolean c);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -