opendap.dap.Server
Interface BTFunction

All Superinterfaces:
ServerSideFunction
All Known Implementing Classes:
SSFdummyval

public interface BTFunction
extends ServerSideFunction

Represents a server-side function, which evaluates to a BaseType. Custom server-side functions which return non-boolean values should implement this interface. For an efficient implementation, it is suggested, when possible, to use the same BaseType for the getType() method and for each successive invocation of evaluate(), changing only the BaseType's value. This avoids creation of large numbers of BaseTypes during a data request.

Author:
joew
See Also:
BTFunctionClause

Method Summary
 BaseType evaluate(java.util.List args)
          Evaluates the function using the argument list given.
 BaseType getReturnType(java.util.List args)
          A given function must always evaluate to the same class of BaseType.
 
Methods inherited from interface opendap.dap.Server.ServerSideFunction
checkArgs, getName
 

Method Detail

getReturnType

BaseType getReturnType(java.util.List args)
                       throws InvalidParameterException
A given function must always evaluate to the same class of BaseType. Only the value held by the BaseType may change. This method can be used to discover the BaseType class of a function without actually evaluating it.

Throws:
InvalidParameterException

evaluate

BaseType evaluate(java.util.List args)
                  throws DAP2ServerSideException
Evaluates the function using the argument list given.

Throws:
DAP2ServerSideException - Thrown if the function cannot evaluate successfully. The exact type of exception is up to the author of the server-side function.