public abstract class SDString extends DString implements ServerMethods, RelOps, ExprParserConstants
String
value.BaseType
,
Serialized FormDAPNode.CloneMap
_nameClear, _nameEncoded, log
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
Constructor and Description |
---|
SDString()
Constructs a new
SDString . |
SDString(java.lang.String n)
Constructs a new
SDString with name n . |
Modifier and Type | Method and Description |
---|---|
boolean |
equal(BaseType bt)
The RelOps interface defines how each type responds to relational
operators.
|
boolean |
greater_eql(BaseType bt)
The
Operator class contains a generalized implementation
of this method. |
boolean |
greater(BaseType bt)
The
Operator class contains a generalized implementation
of this method. |
boolean |
isRead()
Get the value of the Read property.
|
boolean |
isSynthesized()
Get the value of the Synthesized property.
|
boolean |
less_eql(BaseType bt)
The
Operator class contains a generalized implementation
of this method. |
boolean |
less(BaseType bt)
The
Operator class contains a generalized implementation
of this method. |
boolean |
not_equal(BaseType bt)
The
Operator class contains a generalized implementation
of this method. |
void |
printDecl(java.io.PrintWriter os,
java.lang.String space,
boolean print_semi,
boolean constrained)
Write the variable's declaration in a C-style syntax.
|
void |
printVal(java.io.PrintWriter os,
java.lang.String space,
boolean print_decl_p)
Prints the value of the variable, with its declaration.
|
void |
printXML(java.io.PrintWriter pw,
java.lang.String pad,
boolean constrained)
Write the variable's declaration in XML.
|
abstract boolean |
read(java.lang.String datasetName,
java.lang.Object specialO)
Read a value from the named dataset for this variable.
|
boolean |
regexp(BaseType bt)
The
Operator class contains a generalized implementation
of this method. |
void |
serialize(java.lang.String dataset,
java.io.DataOutputStream sink,
CEEvaluator ce,
java.lang.Object specialO)
Server-side serialization for OPeNDAP variables (sub-classes of
BaseType ). |
void |
setRead(boolean state)
Set the Read property.
|
void |
setSynthesized(boolean state)
Set the Synthesized property.
|
deserialize, externalize, getTypeName, getValue, printConstraint, setValue
addAttributeAlias, addAttributeContainer, appendAttribute, appendAttribute, appendAttributeContainer, checkSemantics, checkSemantics, cloneDAG, delAttribute, delAttribute, elementCount, elementCount, getAttribute, getAttribute, getAttributeNames, getAttributeTable, getLongName, hasAttributes, newPrimitiveVector, printAttributes, printAttributes, printAttributes, printAttributes, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, printXML, printXML, printXML, printXML, setClearName
clone, cloneDAG, getClearName, getEncodedName, getParent, isProject, setEncodedName, setParent, setProject, setProject, setProjected
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isProject, setProject, setProject
public SDString()
SDString
.public SDString(java.lang.String n)
SDString
with name n
.n
- the name of the variable.public void printDecl(java.io.PrintWriter os, java.lang.String space, boolean print_semi, boolean constrained)
printDecl
in class BaseType
os
- The PrintWriter
on 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.DDS
public void printVal(java.io.PrintWriter os, java.lang.String space, boolean print_decl_p)
printVal()
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.
isProject()
for a particular variable returns
true
then printVal()
will print a value
(or a declaration and a value).
isProject()
for a particular variable returns
false
then printVal()
is basically a No-Op.
printVal
in class DString
os
- the PrintWriter
on which to print the value.space
- this value is passed to the printDecl
method,
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.BaseType.printVal(PrintWriter, String, boolean)
,
ServerMethods.isProject()
public boolean equal(BaseType bt) throws InvalidOperatorException, RegExpException, SBHException
equal
in interface RelOps
equal
in interface ServerMethods
bt
- The variable to which to compare 'this' value.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.Operator
public boolean not_equal(BaseType bt) throws InvalidOperatorException, RegExpException, SBHException
ServerMethods
Operator
class contains a generalized implementation
of this method. It should be used unless a localized
architecture/implementation requires otherwise.not_equal
in interface RelOps
not_equal
in interface ServerMethods
bt
- The variable to which to compare 'this' value.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.Operator
public boolean greater(BaseType bt) throws InvalidOperatorException, RegExpException, SBHException
ServerMethods
Operator
class contains a generalized implementation
of this method. It should be used unless a localized
architecture/implementation requires otherwise.greater
in interface RelOps
greater
in interface ServerMethods
bt
- The variable to which to compare 'this' value.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.Operator
public boolean greater_eql(BaseType bt) throws InvalidOperatorException, RegExpException, SBHException
ServerMethods
Operator
class contains a generalized implementation
of this method. It should be used unless a localized
architecture/implementation requires otherwise.greater_eql
in interface RelOps
greater_eql
in interface ServerMethods
bt
- The variable to which to compare 'this' value.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.Operator
public boolean less(BaseType bt) throws InvalidOperatorException, RegExpException, SBHException
ServerMethods
Operator
class contains a generalized implementation
of this method. It should be used unless a localized
architecture/implementation requires otherwise.less
in interface RelOps
less
in interface ServerMethods
bt
- The variable to which to compare 'this' value.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.Operator
public boolean less_eql(BaseType bt) throws InvalidOperatorException, RegExpException, SBHException
ServerMethods
Operator
class contains a generalized implementation
of this method. It should be used unless a localized
architecture/implementation requires otherwise.less_eql
in interface RelOps
less_eql
in interface ServerMethods
bt
- The variable to which to compare 'this' value.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.Operator
public boolean regexp(BaseType bt) throws InvalidOperatorException, RegExpException, SBHException
ServerMethods
Operator
class contains a generalized implementation
of this method. It should be used unless a localized
architecture/implementation requires otherwise.regexp
in interface RelOps
regexp
in interface ServerMethods
bt
- The variable to which to compare 'this' value.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.Operator
public void setSynthesized(boolean state)
setSynthesized
in interface ServerMethods
state
- If true
then the variable is considered a
synthetic variable and no part of OPeNDAP will ever try to read it from a
file, otherwise if false
the variable is considered a
normal variable whose value should be read using the
read()
method. By default this property is false.isSynthesized()
,
read(String, Object)
public boolean isSynthesized()
isSynthesized
in interface ServerMethods
true
if this is a synthetic variable,
false
otherwise.public void setRead(boolean state)
read()
method. Once read the Read property is
true
. Use this function to manually set the property
value. By default this property is false.setRead
in interface ServerMethods
state
- true
if the variable has been read,
false
otherwise.isRead()
,
read(String, Object)
public boolean isRead()
isRead
in interface ServerMethods
true
if the variable has been read,
false
otherwise.read(String, Object)
,
setRead(boolean)
public abstract boolean read(java.lang.String datasetName, java.lang.Object specialO) throws NoSuchVariableException, java.io.IOException, java.io.EOFException
read
in interface ServerMethods
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 OPeNDAP server.java.io.IOException
java.io.EOFException
NoSuchVariableException
- When a variable can't be found.public void serialize(java.lang.String dataset, java.io.DataOutputStream sink, CEEvaluator ce, java.lang.Object specialO) throws NoSuchVariableException, DAP2ServerSideException, java.io.IOException
BaseType
).
This does not send the entire class as the Java Serializable
interface does, rather it sends only the binary data values. Other software
is responsible for sending variable type information (see DDS
).
Writes data to a DataOutputStream
. 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.serialize
in interface ServerMethods
sink
- a DataOutputStream
to write to.dataset
- a String
indicated which dataset to read
from (Or something else if you so desire).ce
- the CEEvaluator
to use in the parse process.specialO
- This Object
is 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 a null
.java.io.IOException
- thrown on any OutputStream
exception.NoSuchVariableException
- When a variable cannot be found.DAP2ServerSideException
- When there is a server error.BaseType
,
DDS
,
ServerDDS
public void printXML(java.io.PrintWriter pw, java.lang.String pad, boolean constrained)