Package thredds.server.opendap.servers
Class SDInt16
- java.lang.Object
-
- opendap.dap.DAPNode
-
- opendap.dap.BaseType
-
- opendap.dap.DPrimitive
-
- opendap.dap.DInt16
-
- thredds.server.opendap.servers.SDInt16
-
- All Implemented Interfaces:
Serializable,Cloneable,opendap.dap.ClientIO,ExprParserConstants,RelOps,ServerMethods
- Direct Known Subclasses:
NcSDInt16
public abstract class SDInt16 extends opendap.dap.DInt16 implements ServerMethods, RelOps, ExprParserConstants
Holds a OPeNDAP ServerInt16value.- See Also:
BaseType, Serialized Form
-
-
Field Summary
-
Fields inherited from interface thredds.server.opendap.servers.parsers.ExprParserConstants
AMPERSAND, COLON, COMMA, DEFAULT, EOF, EQUAL, FLOATCONST, FUNCTION, GREATER, GREATER_EQL, INTCONST, LBRACE, LBRACKET, LESS, LESS_EQL, LPAREN, NOT_EQUAL, operatorImage, RBRACE, RBRACKET, REGEXP, RPAREN, SEPARATOR, STRINGCONST, tokenImage, VAR, WORD
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequal(opendap.dap.BaseType bt)The RelOps interface defines how each type responds to relational operators.booleangreater(opendap.dap.BaseType bt)TheOperatorclass contains a generalized implementation of this method.booleangreater_eql(opendap.dap.BaseType bt)TheOperatorclass contains a generalized implementation of this method.booleanisRead()Get the value of the Read property.booleanisSynthesized()Get the value of the Synthesized property.booleanless(opendap.dap.BaseType bt)TheOperatorclass contains a generalized implementation of this method.booleanless_eql(opendap.dap.BaseType bt)TheOperatorclass contains a generalized implementation of this method.booleannot_equal(opendap.dap.BaseType bt)TheOperatorclass contains a generalized implementation of this method.voidprintDecl(PrintWriter os, String space, boolean print_semi, boolean constrained)Write the variable's declaration in a C-style syntax.voidprintVal(PrintWriter os, String space, boolean print_decl_p)Prints the value of the variable, with its declaration.voidprintXML(PrintWriter pw, String pad, boolean constrained)Write the variable's declaration in XML.abstract booleanread(String datasetName, Object specialO)Read a value from the named dataset for this variable.booleanregexp(opendap.dap.BaseType bt)TheOperatorclass contains a generalized implementation of this method.voidserialize(String dataset, DataOutputStream sink, CEEvaluator ce, Object specialO)Server-side serialization for OPeNDAP variables (sub-classes ofBaseType).voidsetRead(boolean state)Set the Read property.voidsetSynthesized(boolean state)Set the Synthesized property.-
Methods inherited from class opendap.dap.DInt16
deserialize, externalize, getTypeName, getValue, newPrimitiveVector, setValue
-
Methods inherited from class opendap.dap.BaseType
addAttributeAlias, addAttributeContainer, appendAttribute, appendAttribute, appendAttributeContainer, checkSemantics, checkSemantics, cloneDAG, delAttribute, delAttribute, elementCount, elementCount, getAttribute, getAttribute, getAttributeNames, getAttributeTable, getLongName, hasAttributes, printAttributes, printAttributes, printAttributes, printAttributes, printConstraint, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, printXML, printXML, printXML, printXML, setClearName
-
Methods inherited from class opendap.dap.DAPNode
clone, cloneDAG, getClearName, getEncodedName, getParent, isProject, setEncodedName, setParent, setProject, setProject, setProjected
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface thredds.server.opendap.servers.ServerMethods
isProject, setProject, setProject
-
-
-
-
Constructor Detail
-
SDInt16
public SDInt16()
Constructs a newSDInt16.
-
SDInt16
public SDInt16(String n)
Constructs a newSDInt16with namen.- Parameters:
n- the name of the variable.
-
-
Method Detail
-
printDecl
public void printDecl(PrintWriter os, String space, boolean print_semi, boolean constrained)
Write the variable's declaration in a C-style syntax. This function is used to create textual representation of the Data Descriptor Structure (DDS). See The OPeNDAP User Manual for information about this structure.- Overrides:
printDeclin classopendap.dap.BaseType- Parameters:
os- ThePrintWriteron which to print the declaration.space- Each line of the declaration will begin with the characters in this string. Usually used for leading spaces.print_semi- a boolean value indicating whether to print a semicolon at the end of the declaration.constrained- a boolean value indicating whether to print the declartion dependent on the projection information. This is only used by Server side code.- See Also:
DDS
-
printVal
public void printVal(PrintWriter os, String space, boolean print_decl_p)
Prints the value of the variable, with its declaration. This function is primarily intended for debugging OPeNDAP applications and text-based clients such as geturl.Important Note
This method overrides the BaseType method of the same name and type signature and it significantly changes the behavior for all versions ofprintVal()for this type: All the various versions of printVal() will only print a value, or a value with declaration, if the variable is in the projection.
In other words, if a call toisProject()for a particular variable returnstruethenprintVal()will print a value (or a declaration and a value).
IfisProject()for a particular variable returnsfalsethenprintVal()is basically a No-Op.
- Overrides:
printValin classopendap.dap.DInt16- Parameters:
os- thePrintWriteron which to print the value.space- this value is passed to theprintDeclmethod, and controls the leading spaces of the output.print_decl_p- a boolean value controlling whether the variable declaration is printed as well as the value.- See Also:
BaseType.printVal(PrintWriter, String, boolean),ServerMethods.isProject()
-
equal
public boolean equal(opendap.dap.BaseType bt) throws InvalidOperatorException, RegExpException, SBHExceptionThe RelOps interface defines how each type responds to relational operators. Most (all?) types will not have sensible responses to all of the relational operators (e.g. DInt won't know how to match a regular expression but DString will). For those operators that are nonsensical a class should throw InvalidOperatorException.- Specified by:
equalin interfaceRelOps- Specified by:
equalin interfaceServerMethods- Parameters:
bt- The variable to which to compare 'this' value.- Returns:
- True when they are equal, false otherwise.
- Throws:
InvalidOperatorException- When the operator cannot be applied to the two data types.RegExpException- When the regular expression is badly formed.SBHException- When Something Bad Happens.- See Also:
Operator
-
not_equal
public boolean not_equal(opendap.dap.BaseType bt) throws InvalidOperatorException, RegExpException, SBHExceptionDescription copied from interface:ServerMethodsTheOperatorclass contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.- Specified by:
not_equalin interfaceRelOps- Specified by:
not_equalin interfaceServerMethods- Parameters:
bt- The variable to which to compare 'this' value.- Returns:
- True when they are not equal, false otherwise.
- Throws:
InvalidOperatorException- When the operator cannot be applied to the two data types.RegExpException- When the regular expression is badly formed.SBHException- When Something Bad Happens.- See Also:
Operator
-
greater
public boolean greater(opendap.dap.BaseType bt) throws InvalidOperatorException, RegExpException, SBHExceptionDescription copied from interface:ServerMethodsTheOperatorclass contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.- Specified by:
greaterin interfaceRelOps- Specified by:
greaterin interfaceServerMethods- Parameters:
bt- The variable to which to compare 'this' value.- Returns:
- True when this value is greater than the based 'bt' value, false otherwise.
- Throws:
InvalidOperatorException- When the operator cannot be applied to the two data types.RegExpException- When the regular expression is badly formed.SBHException- When Something Bad Happens.- See Also:
Operator
-
greater_eql
public boolean greater_eql(opendap.dap.BaseType bt) throws InvalidOperatorException, RegExpException, SBHExceptionDescription copied from interface:ServerMethodsTheOperatorclass contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.- Specified by:
greater_eqlin interfaceRelOps- Specified by:
greater_eqlin interfaceServerMethods- Parameters:
bt- The variable to which to compare 'this' value.- Returns:
- True when this value is greater or equal than the based 'bt' value, false otherwise.
- Throws:
InvalidOperatorException- When the operator cannot be applied to the two data types.RegExpException- When the regular expression is badly formed.SBHException- When Something Bad Happens.- See Also:
Operator
-
less
public boolean less(opendap.dap.BaseType bt) throws InvalidOperatorException, RegExpException, SBHExceptionDescription copied from interface:ServerMethodsTheOperatorclass contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.- Specified by:
lessin interfaceRelOps- Specified by:
lessin interfaceServerMethods- Parameters:
bt- The variable to which to compare 'this' value.- Returns:
- True when this value is less than the based 'bt' value, false otherwise.
- Throws:
InvalidOperatorException- When the operator cannot be applied to the two data types.RegExpException- When the regular expression is badly formed.SBHException- When Something Bad Happens.- See Also:
Operator
-
less_eql
public boolean less_eql(opendap.dap.BaseType bt) throws InvalidOperatorException, RegExpException, SBHExceptionDescription copied from interface:ServerMethodsTheOperatorclass contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.- Specified by:
less_eqlin interfaceRelOps- Specified by:
less_eqlin interfaceServerMethods- Parameters:
bt- The variable to which to compare 'this' value.- Returns:
- True when this value is less than or equal to the based 'bt' value, false otherwise.
- Throws:
InvalidOperatorException- When the operator cannot be applied to the two data types.RegExpException- When the regular expression is badly formed.SBHException- When Something Bad Happens.- See Also:
Operator
-
regexp
public boolean regexp(opendap.dap.BaseType bt) throws InvalidOperatorException, RegExpException, SBHExceptionDescription copied from interface:ServerMethodsTheOperatorclass contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.- Specified by:
regexpin interfaceRelOps- Specified by:
regexpin interfaceServerMethods- Parameters:
bt- The variable to which to compare 'this' value.- Returns:
- True when regular expression evaluates to true., false otherwise.
- Throws:
InvalidOperatorException- When the operator cannot be applied to the two data types.RegExpException- When the regular expression is badly formed.SBHException- When Something Bad Happens.- See Also:
Operator
-
setSynthesized
public void setSynthesized(boolean state)
Set the Synthesized property.- Specified by:
setSynthesizedin interfaceServerMethods- Parameters:
state- Iftruethen the variable is considered a synthetic variable and no part of OPeNDAP will ever try to read it from a file, otherwise iffalsethe variable is considered a normal variable whose value should be read using theread()method. By default this property is false.- See Also:
isSynthesized(),read(String, Object)
-
isSynthesized
public boolean isSynthesized()
Get the value of the Synthesized property.- Specified by:
isSynthesizedin interfaceServerMethods- Returns:
trueif this is a synthetic variable,falseotherwise.
-
setRead
public void setRead(boolean state)
Set the Read property. A normal variable is read using theread()method. Once read the Read property istrue. Use this function to manually set the property value. By default this property is false.- Specified by:
setReadin interfaceServerMethods- Parameters:
state-trueif the variable has been read,falseotherwise.- See Also:
isRead(),read(String, Object)
-
isRead
public boolean isRead()
Get the value of the Read property.- Specified by:
isReadin interfaceServerMethods- Returns:
trueif the variable has been read,falseotherwise.- See Also:
read(String, Object),setRead(boolean)
-
read
public abstract boolean read(String datasetName, Object specialO) throws opendap.dap.NoSuchVariableException, IOException, EOFException
Read a value from the named dataset for this variable.- Specified by:
readin interfaceServerMethods- Parameters:
datasetName- String identifying the file or other data store from which to read a vaue for this variable.specialO- ThisObjectis 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 anull.- Returns:
trueif more data remains to be read, otherwisefalse. This is an abtsract method that must be implemented as part of the installation/localization of a OPeNDAP server.- Throws:
IOExceptionEOFExceptionopendap.dap.NoSuchVariableException- When a variable can't be found.
-
serialize
public void serialize(String dataset, DataOutputStream sink, CEEvaluator ce, Object specialO) throws opendap.dap.NoSuchVariableException, DAP2ServerSideException, IOException
Server-side serialization for OPeNDAP variables (sub-classes ofBaseType). This does not send the entire class as the JavaSerializableinterface does, rather it sends only the binary data values. Other software is responsible for sending variable type information (seeDDS). Writes data to aDataOutputStream. This method is used on the server side of the OPeNDAP client/server connection, and possibly by GUI clients which need to download OPeNDAP data, manipulate it, and then re-save it as a binary file.- Specified by:
serializein interfaceServerMethods- Parameters:
sink- aDataOutputStreamto write to.dataset- aStringindicated which dataset to read from (Or something else if you so desire).ce- theCEEvaluatorto use in the parse process.specialO- ThisObjectis a goody that is used by a Server implementations to deliver important, and as yet unknown, stuff to the read method. If you don't need it, make it anull.- Throws:
IOException- thrown on anyOutputStreamexception.opendap.dap.NoSuchVariableException- When a variable cannot be found.DAP2ServerSideException- When there is a server error.- See Also:
BaseType,DDS,ServerDDS
-
printXML
public void printXML(PrintWriter pw, String pad, boolean constrained)
Write the variable's declaration in XML. This function is used to create the XML representation of the Data Descriptor Structure (DDS). See The OPeNDAP User Manual for information about this structure.- Overrides:
printXMLin classopendap.dap.BaseType- Parameters:
pw- ThePrintWriteron which to print the declaration.pad- Each line of the declaration will begin with the characters in this string. Usually used for leading spaces.constrained- a boolean value indicating whether to print the declartion dependent on the projection information. This is only used by Server side code.- See Also:
DDS
-
-