|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.rmi.server.RemoteObject
ucar.netcdf.RemoteAccessorImpl
RemoteAccessorImpl is a UnicastRemoteObject (RMI service) which implements ucar.multiarray.RemoteAccessor using the proxy pattern. Accessor methods are forwarded to the adaptee and adaptee exceptions are wrapped in java.rmi.ServerException.
| Field Summary |
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
RemoteAccessorImpl(NetcdfRemoteProxyImpl svr,
Accessor adaptee)
Construct a UnicastRemoteObject which acts as an Accessor proxy. |
|
| Method Summary | |
void |
copyin(int[] origin,
MultiArray source)
Aggregate write access. |
MultiArray |
copyout(int[] origin,
int[] shape)
Aggregate read access. |
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,
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. |
Object |
toArray()
Returns a new array containing all of the elements in this MultiArray. |
Object |
toArray(Object dst,
int[] origin,
int[] shape)
Returns an array containing elements of this MultiArray specified by origin and shape, possibly converting the component type. |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public RemoteAccessorImpl(NetcdfRemoteProxyImpl svr,
Accessor adaptee)
throws RemoteException
svr - NetcdfRemoteProxyImpl which owns this.
May be null.adaptee - Accessor to which the Accessor
methods of this are forwarded.| Method Detail |
public Object get(int[] index)
throws RemoteException
Accessor
get in interface RemoteAccessorRemoteException
public boolean getBoolean(int[] index)
throws RemoteException
Accessor
getBoolean in interface RemoteAccessorRemoteException
public char getChar(int[] index)
throws RemoteException
Accessor
getChar in interface RemoteAccessorRemoteException
public byte getByte(int[] index)
throws RemoteException
Accessor
getByte in interface RemoteAccessorRemoteException
public short getShort(int[] index)
throws RemoteException
Accessor
getShort in interface RemoteAccessorRemoteException
public int getInt(int[] index)
throws RemoteException
Accessor
getInt in interface RemoteAccessorRemoteException
public long getLong(int[] index)
throws RemoteException
Accessor
getLong in interface RemoteAccessorRemoteException
public float getFloat(int[] index)
throws RemoteException
Accessor
getFloat in interface RemoteAccessorRemoteException
public double getDouble(int[] index)
throws RemoteException
Accessor
getDouble in interface RemoteAccessorRemoteException
public void set(int[] index,
Object value)
throws RemoteException
Accessor
set in interface RemoteAccessorRemoteException
public void setBoolean(int[] index,
boolean value)
throws RemoteException
Accessor
setBoolean in interface RemoteAccessorRemoteException
public void setChar(int[] index,
char value)
throws RemoteException
Accessor
setChar in interface RemoteAccessorRemoteException
public void setByte(int[] index,
byte value)
throws RemoteException
Accessor
setByte in interface RemoteAccessorRemoteException
public void setShort(int[] index,
short value)
throws RemoteException
Accessor
setShort in interface RemoteAccessorRemoteException
public void setInt(int[] index,
int value)
throws RemoteException
Accessor
setInt in interface RemoteAccessorRemoteException
public void setLong(int[] index,
long value)
throws RemoteException
Accessor
setLong in interface RemoteAccessorRemoteException
public void setFloat(int[] index,
float value)
throws RemoteException
Accessor
setFloat in interface RemoteAccessorRemoteException
public void setDouble(int[] index,
double value)
throws RemoteException
Accessor
setDouble in interface RemoteAccessorRemoteException
public MultiArray copyout(int[] origin,
int[] shape)
throws RemoteException
AccessorIt 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 RemoteAccessorRemoteException
public void copyin(int[] origin,
MultiArray source)
throws RemoteException
AccessorHopefully this member can be optimized in various situations.
assert(origin[ii] + (source.getLengths())[ii]
<= (getLengths())[ii]);
copyin in interface RemoteAccessorRemoteException
public Object toArray()
throws RemoteException
AccessorThis 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 RemoteAccessorRemoteException
public Object toArray(Object dst,
int[] origin,
int[] shape)
throws RemoteException
AccessorThe 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 RemoteAccessorRemoteException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||