public class AttributeTable extends DAPNode implements Iterable<String>
AttributeTable stores a set of names and, for each name,
an Attribute object.
It is an Iterable< that returns the attribute names in insert order.DAPNode.CloneMap_nameClear, _nameEncoded, log| Constructor and Description |
|---|
AttributeTable(String clearname)
Create a new empty
AttributeTable. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAlias(String alias,
String attributeName)
Add an alias to the current table.
|
void |
addContainer(String clearname,
AttributeTable at)
Create and append an attribute container to the table.
|
void |
appendAttribute(String clearname,
int type,
String value)
Adds an attribute to the table.
|
void |
appendAttribute(String clearname,
int type,
String value,
boolean check)
Adds an attribute to the table.
|
AttributeTable |
appendContainer(String clearname)
Create and append an attribute container to the table.
|
AttributeTable |
cloneDAG(DAPNode.CloneMap map)
Returns a copy of this
AttributeTable. |
void |
delAttribute(String clearname)
Delete the attribute named
name. |
void |
delAttribute(String clearname,
int i)
Delete the attribute named
name. |
Attribute |
getAttribute(String clearname)
Returns the
Attribute which matches name. |
Iterator<String> |
iterator() |
void |
print(OutputStream os)
Print the attribute table on the given
OutputStream with
four spaces of indentation. |
void |
print(OutputStream os,
String pad)
Print the attribute table on the given
OutputStream. |
void |
print(PrintStream os)
Print the attribute table on the given
PrintWriter with
four spaces of indentation. |
void |
print(PrintWriter os)
Print the attribute table on the given
PrintWriter with
four spaces of indentation. |
void |
print(PrintWriter os,
String pad)
Print the attribute table on the given
PrintWriter. |
void |
printXML(OutputStream os,
String pad) |
void |
printXML(PrintWriter pw) |
void |
printXML(PrintWriter pw,
String pad) |
void |
printXML(PrintWriter pw,
String pad,
boolean constrained) |
int |
size() |
String |
toString() |
clone, cloneDAG, getClearName, getEncodedName, getParent, isProject, setClearName, setEncodedName, setParent, setProject, setProject, setProjectedequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic AttributeTable(String clearname)
AttributeTable.public int size()
@Nullable public final Attribute getAttribute(String clearname)
Attribute which matches name.public final void appendAttribute(String clearname, int type, String value, boolean check) throws DASException
check parameter
is true. Use the appendContainer method to add container
attributes.clearname - 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 typeDASExceptionappendContainer(String)public final void appendAttribute(String clearname, int type, String value) throws DASException
appendContainer
method to add container attributes.clearname - 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 typeDASExceptionappendContainer(String)@Nullable public final AttributeTable appendContainer(String clearname)
AttributeTable object.clearname - the name of the container to add.AttributeTable object, or null
if a container by that name already exists.public final void addContainer(String clearname, AttributeTable at) throws AttributeExistsException
AttributeTable object.clearname - the name of the container to add.
if a container by that name already exists.AttributeExistsExceptionpublic final void addAlias(String alias, String attributeName) throws 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.AttributeExistsException - thrown if the new alias has the same
name as an existing attribute.public final void delAttribute(String clearname)
name.clearname - The name of the attribute to delete. This can be an
attribute of any type, including containers.public final void delAttribute(String clearname, int i) throws DASException
name. If the attribute has a
vector value, delete the i'th element of the vector.clearname - 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.DASExceptiondelAttribute(String)public void print(PrintWriter os, String pad)
PrintWriter.os - the PrintWriter to use for output.pad - the number of spaces to indent each line.public final void print(OutputStream os, String pad)
OutputStream.os - the OutputStream to use for output.pad - the number of spaces to indent each line.public final void print(PrintStream os)
PrintWriter with
four spaces of indentation.os - the PrintWriter to use for output.public final void print(PrintWriter os)
PrintWriter with
four spaces of indentation.os - the PrintWriter to use for output.public final void print(OutputStream os)
OutputStream with
four spaces of indentation.os - the OutputStream to use for output.public void printXML(OutputStream os, String pad)
public void printXML(PrintWriter pw)
public void printXML(PrintWriter pw, String pad)
public void printXML(PrintWriter pw, String pad, boolean constrained)
public AttributeTable cloneDAG(DAPNode.CloneMap map) throws CloneNotSupportedException
AttributeTable.cloneDAG in class DAPNodemap - list of previously cloned nodesCloneNotSupportedException