|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdods.dap.BaseType
dods.dap.DVector
dods.dap.DArray
dods.dap.Server.SDArray
dods.servers.agg.ProxySDArray
public class ProxySDArray
Proxy for an array in another (DODS) dataset. If its 1D, read the entire array the first time and cache it.
Method Summary | |
---|---|
static BaseType |
assignBaseType(BaseType bt)
Override so we can cache the whole array, and subset it locally. |
Object |
getProxy()
get the underlying proxy |
boolean |
read(String datasetName,
Object specialO)
Read the value from original dataset (parameters are ignored). |
void |
setProxy(Object v)
get/set the underlying proxy |
Methods inherited from class dods.dap.Server.SDArray |
---|
appendDim, appendDim, equal, getStart, getStop, getStride, greater_eql, greater, isProject, isRead, isSynthesized, less_eql, less, not_equal, printDecl, printVal, regexp, serialize, setProject, setProject, setProjection, setRead, setSynthesized |
Methods inherited from class dods.dap.DArray |
---|
checkSemantics, clone, getDimension, getDimensions, getFirstDimension, getTypeName, numDimensions |
Methods inherited from class dods.dap.DVector |
---|
addVariable, deserialize, externalize, getLength, getPrimitiveVector, setLength |
Methods inherited from class dods.dap.BaseType |
---|
checkSemantics, elementCount, elementCount, getLongName, getName, getParent, newPrimitiveVector, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, setName, setParent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void setProxy(Object v)
setProxy
in interface HasProxyObject
public Object getProxy()
HasProxyObject
getProxy
in interface HasProxyObject
public boolean read(String datasetName, Object specialO) throws IOException, EOFException
read
in interface ServerMethods
read
in class SDArray
datasetName
- String identifying the file or other data store
from which to read a vaue for this variable.specialO
- This Object
is a goody that is used by Server implementations
to deliver important, and as yet unknown, stuff to the read method. If you
don't need it, make it a null
.
true
if more data remains to be read, otherwise
false
. This is an abtsract method that must be implemented
as part of the installation/localization of a DODS server.
IOException
EOFException
public static BaseType assignBaseType(BaseType bt)
dataset
- sink
- ce
- specialO
-
NoSuchVariableException
SDODSException
IOException
- public void serialize(String dataset, DataOutputStream sink, CEEvaluator ce, Object specialO)
throws NoSuchVariableException,SDODSException, IOException {
if (!ce.evalClauses(specialO)) return;
if(!isRead())
read(dataset, specialO);
PrimitiveVector vals = getPrimitiveVector();
if (cachedData) {
// full data is in the PrimitiveVector, just have to subset it
int stride0 = (getStride(0) > 1) ? getStride(0) : 1;
int length = 1 + (getStop(0) - getStart(0)) / stride0;
sink.writeInt(length);
if(vals instanceof BaseTypePrimitiveVector){
BaseTypePrimitiveVector bvals = (BaseTypePrimitiveVector) vals;
for(int i=getStart(0); i<=getStop(0); i+=stride0) {
ServerMethods sm = (ServerMethods) bvals.getValue(i);
sm.serialize(dataset,sink,ce, specialO);
}
} else {
sink.writeInt(length);
vals.externalize( sink, getStart(0), getStop(0), stride0);
}
} else {
// just the wanted data is in the PrimitiveVector
int length = vals.getLength();
sink.writeInt(length);
if(vals instanceof BaseTypePrimitiveVector){
BaseTypePrimitiveVector bvals = (BaseTypePrimitiveVector) vals;
for(int i=0; i
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |