|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.multiarray.AbstractAccessor
ucar.netcdf.NetcdfFile.V1Io
| Field Summary | |
(package private) int |
begin
|
(package private) int[] |
dsizes
|
(package private) byte[] |
fillbytes
|
(package private) boolean |
isUnlimited
|
(package private) int |
vsize
|
(package private) int |
xsz
|
| Constructor Summary | |
protected |
NetcdfFile.V1Io(ProtoVariable proto)
|
| Method Summary | |
void |
checkfill(int newLength)
|
(package private) long |
computeOffset(int[] origin)
|
void |
copyin(int[] origin,
MultiArray data)
You almost always want to override this |
void |
copyin(int[] origin,
MultiArrayImpl data)
|
MultiArray |
copyout(int[] origin,
int[] shape)
Aggregate read access. |
(package private) abstract void |
fill(DataOutput dos,
int nbytes,
Attribute fAttr)
|
(package private) void |
fill(int recno)
|
(package private) void |
fillO(long offset)
|
(package private) int |
getRank()
|
(package private) boolean |
isScalar()
|
(package private) abstract void |
readArray(long offset,
Object dst,
int dst_position,
int nelems)
|
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. |
(package private) abstract void |
writeArray(long offset,
Object from,
int begin,
int nelems)
|
| Methods inherited from class ucar.multiarray.AbstractAccessor |
copy, copyO, get, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getShort, set, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
byte[] fillbytes
int vsize
int begin
final boolean isUnlimited
final int[] dsizes
int xsz
| Constructor Detail |
protected NetcdfFile.V1Io(ProtoVariable proto)
| Method Detail |
abstract void readArray(long offset,
Object dst,
int dst_position,
int nelems)
throws IOException
IOException
public MultiArray copyout(int[] origin,
int[] shape)
throws IOException
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 Accessorcopyout in class AbstractAccessorIOException
abstract void writeArray(long offset,
Object from,
int begin,
int nelems)
throws IOException
IOException
public void copyin(int[] origin,
MultiArray data)
throws IOException
AbstractAccessor
copyin in interface Accessorcopyin in class AbstractAccessorIOException
public void copyin(int[] origin,
MultiArrayImpl data)
throws IOException
IOException
public Object toArray()
throws IOException
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 AccessortoArray in class AbstractAccessorIOException
public Object toArray(Object dst,
int[] origin,
int[] shape)
throws IOException
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 AccessortoArray in class AbstractAccessorIOException
public final void checkfill(int newLength)
throws IOException
IOExceptionfinal int getRank()
final boolean isScalar()
final long computeOffset(int[] origin)
abstract void fill(DataOutput dos,
int nbytes,
Attribute fAttr)
throws IOException
IOException
void fillO(long offset)
throws IOException
IOException
void fill(int recno)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||