|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RemoteAccessor
This interface is the same as Accessor, just tagged as java.rmi.Remote. This intervening layer is necessary so that the rmi compiler interpretes concrete multiarrays like MultiArrayImpl as return by value. Otherwise, if Accessor itself were remote, rmic would generate stubs for MultiArrayImpl to be a remote reference.
As of this writing (jdk1.1),
the rmi compiler rmic
is braindead in the
sense that it doesn't recognize that java.rmi.RemoteException isa
java.io.IOException. Hence, we reproduce each method declaration
from Accessor, narrowing the throws specification.
Method Summary | |
---|---|
void |
copyin(int[] origin,
MultiArray source)
Aggregate write access. |
MultiArray |
copyout(int[] origin,
int[] shape)
Aggregate read access. |
java.lang.Object |
get(int[] index)
Get (read) the array element at index. |
boolean |
getBoolean(int[] index)
Get the array element at index, as a boolean. |
byte |
getByte(int[] index)
Get the array element at index, as a byte. |
char |
getChar(int[] index)
Get the array element at index, as a char. |
double |
getDouble(int[] index)
Get the array element at index, as a double. |
float |
getFloat(int[] index)
Get the array element at index, as a float. |
int |
getInt(int[] index)
Get the array element at index, as an int. |
long |
getLong(int[] index)
Get the array element at index, as a long. |
short |
getShort(int[] index)
Get the array element at index, as a short. |
void |
set(int[] index,
java.lang.Object value)
Set (modify, write) the array element at index to the specified value. |
void |
setBoolean(int[] index,
boolean value)
Set the array element at index to the specified boolean value. |
void |
setByte(int[] index,
byte value)
Set the array element at index to the specified byte value. |
void |
setChar(int[] index,
char value)
Set the array element at index to the specified char value. |
void |
setDouble(int[] index,
double value)
Set the array element at index to the specified double value. |
void |
setFloat(int[] index,
float value)
Set the array element at index to the specified float value. |
void |
setInt(int[] index,
int value)
Set the array element at index to the specified int value. |
void |
setLong(int[] index,
long value)
Set the array element at index to the specified long value. |
void |
setShort(int[] index,
short value)
Set the array element at index to the specified short value. |
java.lang.Object |
toArray()
Returns a new array containing all of the elements in this MultiArray. |
java.lang.Object |
toArray(java.lang.Object anArray,
int[] origin,
int[] shape)
Returns an array containing elements of this MultiArray specified by origin and shape, possibly converting the component type. |
Method Detail |
---|
java.lang.Object get(int[] index) throws java.rmi.RemoteException
Accessor
get
in interface Accessor
index
- MultiArray index
index
java.rmi.RemoteException
boolean getBoolean(int[] index) throws java.rmi.RemoteException
Accessor
getBoolean
in interface Accessor
java.rmi.RemoteException
Accessor.get(int[])
char getChar(int[] index) throws java.rmi.RemoteException
Accessor
getChar
in interface Accessor
java.rmi.RemoteException
Accessor.get(int[])
byte getByte(int[] index) throws java.rmi.RemoteException
Accessor
getByte
in interface Accessor
java.rmi.RemoteException
Accessor.get(int[])
short getShort(int[] index) throws java.rmi.RemoteException
Accessor
getShort
in interface Accessor
java.rmi.RemoteException
Accessor.get(int[])
int getInt(int[] index) throws java.rmi.RemoteException
Accessor
getInt
in interface Accessor
java.rmi.RemoteException
Accessor.get(int[])
long getLong(int[] index) throws java.rmi.RemoteException
Accessor
getLong
in interface Accessor
java.rmi.RemoteException
Accessor.get(int[])
float getFloat(int[] index) throws java.rmi.RemoteException
Accessor
getFloat
in interface Accessor
java.rmi.RemoteException
Accessor.get(int[])
double getDouble(int[] index) throws java.rmi.RemoteException
Accessor
getDouble
in interface Accessor
java.rmi.RemoteException
Accessor.get(int[])
void set(int[] index, java.lang.Object value) throws java.rmi.RemoteException
Accessor
set
in interface Accessor
index
- MultiArray indexvalue
- the new value.
java.rmi.RemoteException
void setBoolean(int[] index, boolean value) throws java.rmi.RemoteException
Accessor
setBoolean
in interface Accessor
java.rmi.RemoteException
Accessor.set(int[], java.lang.Object)
void setChar(int[] index, char value) throws java.rmi.RemoteException
Accessor
setChar
in interface Accessor
java.rmi.RemoteException
Accessor.set(int[], java.lang.Object)
void setByte(int[] index, byte value) throws java.rmi.RemoteException
Accessor
setByte
in interface Accessor
java.rmi.RemoteException
Accessor.set(int[], java.lang.Object)
void setShort(int[] index, short value) throws java.rmi.RemoteException
Accessor
setShort
in interface Accessor
java.rmi.RemoteException
Accessor.set(int[], java.lang.Object)
void setInt(int[] index, int value) throws java.rmi.RemoteException
Accessor
setInt
in interface Accessor
java.rmi.RemoteException
Accessor.set(int[], java.lang.Object)
void setLong(int[] index, long value) throws java.rmi.RemoteException
Accessor
setLong
in interface Accessor
java.rmi.RemoteException
Accessor.set(int[], java.lang.Object)
void setFloat(int[] index, float value) throws java.rmi.RemoteException
Accessor
setFloat
in interface Accessor
java.rmi.RemoteException
Accessor.set(int[], java.lang.Object)
void setDouble(int[] index, double value) throws java.rmi.RemoteException
Accessor
setDouble
in interface Accessor
java.rmi.RemoteException
Accessor.set(int[], java.lang.Object)
MultiArray copyout(int[] origin, int[] shape) throws java.rmi.RemoteException
Accessor
It is easier to implement than to specify :-).
The main reason to implement this instead of using the equivalent proxy is for remote or file access.
assert(origin[ii] + shape[ii] <= lengths[ii]);
copyout
in interface Accessor
origin
- int array specifying the starting index.shape
- int array specifying the extents in each
dimension. This becomes the shape of the return.
java.rmi.RemoteException
void copyin(int[] origin, MultiArray source) throws java.rmi.RemoteException
Accessor
Hopefully this member can be optimized in various situations.
assert(origin[ii] + (source.getLengths())[ii]
<= (getLengths())[ii]);
copyin
in interface Accessor
origin
- int array specifying the starting index.source
- MultiArray with the same componentType as
this and shape smaller than
this.getLengths() - origin
java.rmi.RemoteException
java.lang.Object toArray() throws java.rmi.RemoteException
Accessor
This method acts as bridge between array-based and MultiArray-based APIs.
This method is functionally equivalent to
Object anArray = Array.newInstance(getComponentType(), 1); int [] origin = new int[getRank()] int [] shape = getDimensions(); return toArray(anArray, origin, shape);
toArray
in interface Accessor
java.rmi.RemoteException
java.lang.Object toArray(java.lang.Object anArray, int[] origin, int[] shape) throws java.rmi.RemoteException
Accessor
The anArray argument should be an array. If it is large enough to contain the output, it is used and no new storage is allocated. Otherwise, new storage is allocated with the same component type as the argument, and the data is copied into it.
This method acts as bridge between array-based and MultiArray-based APIs.
This method is similar to copyout(origin, shape).toArray(), but avoids a copy operation and (potentially) an allocation.
NOTE: Implementation of type conversion is deferred until
JDK 1.2. Currently, the componentType of anArray
must be the same as this
toArray
in interface Accessor
java.rmi.RemoteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |