Exemplo n.º 1
0
 /**
  * Returns the adapter corresponding to a DODS variable.
  *
  * @param var A DODS variable.
  * @param das The DODS DAS in which the attribute table for the DODS variable is embedded.
  * @return The adapter corresponding to the DODS variable.
  * @throws BadFormException The DODS information is corrupt.
  * @throws VisADException VisAD failure.
  * @throws RemoteException Java RMI failure.
  */
 public VariableAdapter variableAdapter(BaseType var, DAS das)
     throws BadFormException, VisADException, RemoteException {
   VariableAdapter adapter;
   if (var instanceof DString) adapter = stringVariableAdapter((DString) var, das);
   else if (var instanceof DBoolean) adapter = booleanVariableAdapter((DBoolean) var, das);
   else if (var instanceof DByte) adapter = byteVariableAdapter((DByte) var, das);
   else if (var instanceof DUInt16) adapter = uInt16VariableAdapter((DUInt16) var, das);
   else if (var instanceof DInt16) adapter = int16VariableAdapter((DInt16) var, das);
   else if (var instanceof DUInt32) adapter = uInt32VariableAdapter((DUInt32) var, das);
   else if (var instanceof DInt32) adapter = int32VariableAdapter((DInt32) var, das);
   else if (var instanceof DFloat32) adapter = float32VariableAdapter((DFloat32) var, das);
   else if (var instanceof DFloat64) adapter = float64VariableAdapter((DFloat64) var, das);
   else if (var instanceof DStructure) adapter = structureVariableAdapter((DStructure) var, das);
   else if (var instanceof DList) adapter = listVariableAdapter((DList) var, das);
   else if (var instanceof DSequence) adapter = sequenceVariableAdapter((DSequence) var, das);
   else if (var instanceof DArray) adapter = arrayVariableAdapter((DArray) var, das);
   else if (var instanceof DGrid) adapter = gridVariableAdapter((DGrid) var, das);
   else
     throw new BadFormException(
         getClass().getName()
             + ".variableAdapter(...): "
             + "Unknown DODS type: "
             + var.getTypeName());
   return adapter;
 }