|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopendap.dap.AttributeTable
public class AttributeTable
An AttributeTable
stores a set of names and, for each name,
an Attribute
object. For more information on the types of
data which can be stored in an attribute, including aliases and other
AttributeTable
objects, see the documentation for
Attribute
.
print
method for writing this form and a parse
method for reading the printed form.
An AttributeTable
's print representation might look like:
String long_name "Weekly Means of Sea Surface Temperature";or
actual_range { Float64 min -1.8; Float64 max 35.09; }or
String Investigators "Cornillon", "Fleirl", "Watts";or
Alias New_Attribute Old_Attribute;Here, long_name and Investigators are simple attributes, actual_range is a container attribute, and New_Attribute is an alias pointing to Old_Attribute.
DAS
,
Attribute
,
Serialized FormConstructor Summary | |
---|---|
AttributeTable()
Deprecated. Use constructor that takes the name of the table. |
|
AttributeTable(java.lang.String name)
Create a new empty AttributeTable . |
Method Summary | |
---|---|
void |
addAlias(java.lang.String alias,
java.lang.String attributeName)
Add an alias to the current table. |
void |
addContainer(java.lang.String name,
AttributeTable at)
Create and append an attribute container to the table. |
void |
appendAttribute(java.lang.String name,
int type,
java.lang.String value)
Adds an attribute to the table. |
void |
appendAttribute(java.lang.String name,
int type,
java.lang.String value,
boolean check)
Adds an attribute to the table. |
AttributeTable |
appendContainer(java.lang.String name)
Create and append an attribute container to the table. |
java.lang.Object |
clone()
Returns a clone of this AttributeTable . |
void |
delAttribute(java.lang.String name)
Delete the attribute named name . |
void |
delAttribute(java.lang.String name,
int i)
Delete the attribute named name . |
Attribute |
getAttribute(java.lang.String name)
Returns the Attribute which matches name. |
java.lang.String |
getClearName()
Returns the name of this AttributeTable. |
java.lang.String |
getName()
Returns the name of this AttributeTable. |
java.util.Enumeration |
getNames()
Returns an Enumeration of the attribute names in this
AttributeTable . |
boolean |
hasAttribute(java.lang.String name)
Returns the Attribute which matches name. |
void |
print(java.io.OutputStream os)
Print the attribute table on the given OutputStream with
four spaces of indentation. |
void |
print(java.io.OutputStream os,
java.lang.String pad)
Print the attribute table on the given OutputStream . |
void |
print(java.io.PrintWriter os)
Print the attribute table on the given PrintWriter with
four spaces of indentation. |
void |
print(java.io.PrintWriter os,
java.lang.String pad)
Print the attribute table on the given PrintWriter . |
void |
printXML(java.io.OutputStream os)
|
void |
printXML(java.io.OutputStream os,
java.lang.String pad)
|
void |
printXML(java.io.PrintWriter pw)
|
void |
printXML(java.io.PrintWriter pw,
java.lang.String pad)
|
void |
printXML(java.io.PrintWriter pw,
java.lang.String pad,
boolean constrained)
|
void |
setClearName(java.lang.String n)
Returns the name of this AttributeTable. |
void |
setName(java.lang.String n)
Returns the name of this AttributeTable. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeTable()
AttributeTable
.
public AttributeTable(java.lang.String name)
AttributeTable
.
Method Detail |
---|
public java.lang.Object clone()
AttributeTable
. A deep copy is
performed on all Attribute
and AttributeTable
objects inside the AttributeTable
.
clone
in class java.lang.Object
AttributeTable
.public final java.lang.String getName()
public final void setName(java.lang.String n)
public final java.lang.String getClearName()
public final void setClearName(java.lang.String n)
public final java.util.Enumeration getNames()
Enumeration
of the attribute names in this
AttributeTable
.
Use the getAttribute
method to get the
Attribute
for a given name.
Enumeration
of String
.getAttribute(String)
public final Attribute getAttribute(java.lang.String name)
Attribute
which matches name.
name
- the name of the Attribute
to return.
Attribute
with the specified name, or null
if there is no matching Attribute
.Attribute
public final boolean hasAttribute(java.lang.String name)
Attribute
which matches name.
name
- the name of the Attribute
to return.
Attribute
public final void appendAttribute(java.lang.String name, int type, java.lang.String value, boolean check) throws DASException
check
parameter
is true. Use the appendContainer
method to add container
attributes.
name
- The name of the attribute to add or modify.type
- The type code of the attribute to add or modify.value
- The value to add to the attribute table.check
- Check the validity of the attribute's value?
AttributeExistsException
- thrown if an Attribute with the same
name, but a different type was previously defined.
AttributeBadValueException
- thrown if the value is not a legal
member of type
DASException
appendContainer(String)
public final void appendAttribute(java.lang.String name, int type, java.lang.String value) throws DASException
appendContainer
method to add container attributes.
name
- The name of the attribute to add or modify.type
- The type code of the attribute to add or modify.value
- The value to add to the attribute table.
AttributeExistsException
- thrown if an Attribute with the same
name, but a different type was previously defined.
AttributeBadValueException
- thrown if the value is not a legal
member of type
DASException
appendContainer(String)
public final AttributeTable appendContainer(java.lang.String name)
AttributeTable
object.
name
- the name of the container to add.
AttributeTable
object, or null
if a container by that name already exists.public final void addContainer(java.lang.String name, AttributeTable at) throws AttributeExistsException
AttributeTable
object.
name
- the name of the container to add.
if a container by that name already exists.
AttributeExistsException
public final void addAlias(java.lang.String alias, java.lang.String attributeName) throws NoSuchAttributeException, AttributeExistsException
addAlias(String, String, String)
and is the preffered
way of representing the DAS information.
alias
- The alias to insert into the attribute table.attributeName
- The normalized name of the attribute to which
the alias will refer.
NoSuchAttributeException
- thrown if the existing attribute
could not be found.
AttributeExistsException
- thrown if the new alias has the same
name as an existing attribute.public final void delAttribute(java.lang.String name)
name
.
name
- The name of the attribute to delete. This can be an
attribute of any type, including containers.public final void delAttribute(java.lang.String name, int i) throws DASException
name
. If the attribute has a
vector value, delete the i
'th element of the vector.
name
- The name of the attribute to delete. This can be an
attribute of any type, including containers.i
- If the named attribute is a vector, and i
is
non-negative, the i
'th entry in the vector is deleted.
If i
equals -1, the entire attribute is deleted.
DASException
delAttribute(String)
public void print(java.io.PrintWriter os, java.lang.String pad)
PrintWriter
.
os
- the PrintWriter
to use for output.pad
- the number of spaces to indent each line.public final void print(java.io.OutputStream os, java.lang.String pad)
OutputStream
.
os
- the OutputStream
to use for output.pad
- the number of spaces to indent each line.public final void print(java.io.PrintWriter os)
PrintWriter
with
four spaces of indentation.
os
- the PrintWriter
to use for output.public final void print(java.io.OutputStream os)
OutputStream
with
four spaces of indentation.
os
- the OutputStream
to use for output.public void printXML(java.io.OutputStream os)
os
- This class/method is associated with pre-release version of the DDX API. It is experimental and is subject to (significant) change.
public void printXML(java.io.OutputStream os, java.lang.String pad)
os
- pad
- This class/method is associated with pre-release version of the DDX API. It is experimental and is subject to (significant) change.
public void printXML(java.io.PrintWriter pw)
pw
- This class/method is associated with pre-release version of the DDX API. It is experimental and is subject to (significant) change.
public void printXML(java.io.PrintWriter pw, java.lang.String pad)
pw
- pad
- This class/method is associated with pre-release version of the DDX API. It is experimental and is subject to (significant) change.
public void printXML(java.io.PrintWriter pw, java.lang.String pad, boolean constrained)
pw
- pad
- constrained
- This class/method is associated with pre-release version of the DDX API. It is experimental and is subject to (significant) change.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |