All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.bmrb.starlibj.DataItemNode

java.lang.Object
   |
   +----EDU.bmrb.starlibj.StarNode
           |
           +----EDU.bmrb.starlibj.DataItemNode

public class DataItemNode
extends StarNode
Holds a single "free" tag and value pair. Can be found inside SaveFrameNodes and BlockNodes


Variable Index

 o myDataName
 o myDataValue

Constructor Index

 o DataItemNode(DataItemNode)
copy constructor:
 o DataItemNode(DataNameNode, DataValueNode)
This constructor makes a new item with the given name and value.
 o DataItemNode(String, String)
This constructor makes a new item with the given name and string value, giving it the default delimiter type of DataValueNode::NON.
 o DataItemNode(String, String, short)
Make a new item given the name and value and delimiter type.

Method Index

 o clone()
Allocates a new copy of me and returns a reference to it.
 o getDelimType()
Returns the delimiter type of the value in this item.
 o getLabel()
Gets the String tag name of this item.
 o getNameNode()
Gets the entire DataNameNode inside this item (as opposed to just the string name like getLabel() does.)
 o getValue()
Gets the String value of this item.
 o getValueNode()
getValueNode() is like getValue(), but it returns the whole DataValueNode, not just the string inside it.
 o searchByName(String)
Included for orthogonality with StarNode.
 o searchByTagValue(String, String)
Included for orthogonality with StarNode.
 o searchForType(Class, short)
Included for orthogonality with StarNode.
 o setDelimType(short)
Sets the delimiter type of the value in this item.
 o setLabel(String)
Sets the String tag name of this item - it's an exception if the name does not begin with an underscore.
 o setValue(String)
Sets the string value of this item.
 o setValue(String, short)
Sets the String value and delimiter of this item together.
 o Unparse(int)
Unparse prints the contents of the StarNode object out to the given stream.

Variables

 o myDataName
 protected DataNameNode myDataName
 o myDataValue
 protected DataValueNode myDataValue

Constructors

 o DataItemNode
 public DataItemNode(DataNameNode name,
                     DataValueNode value) throws NameViolatesStarSyntax
This constructor makes a new item with the given name and value. It makes a copy of the value passed, not a reference to it.

Throws: NameViolatesStarSyntax
if the tag name is not valid star syntax for a tag name.
 o DataItemNode
 public DataItemNode(String name,
                     String value) throws NameViolatesStarSyntax, BadValueForDelimiter
This constructor makes a new item with the given name and string value, giving it the default delimiter type of DataValueNode::NON. Copies of the strings are made, not references.

Throws: NameViolatesStarSyntax
if the tag name is not valid star syntax for a tag name.
Throws: BadValueForDelimiter
if the value for the node won't be valid syntax given the kind of delimiter the node has.
 o DataItemNode
 public DataItemNode(String name,
                     String value,
                     short delim) throws NameViolatesStarSyntax, BadValueForDelimiter
Make a new item given the name and value and delimiter type. Note that no checking is done to ensure that the delimiter type given is appropriate for the value given. (It is possible to make a value with spaces and tell it to be nonquoted, for example.)

Copies of the strings are made, not references.

Throws: NameViolatesStarSyntax
if the tag name is not valid star syntax for a tag name.
Throws: BadValueForDelimiter
if the value for the node won't be valid syntax given the kind of delimiter the node has.
 o DataItemNode
 public DataItemNode(DataItemNode copyMe)
copy constructor:

Methods

 o clone
 public Object clone()
Allocates a new copy of me and returns a reference to it. This is a deep copy, meaning that all children are copied instead of linked.

Overrides:
clone in class StarNode
 o getDelimType
 public short getDelimType()
Returns the delimiter type of the value in this item.

See Also:
DataValueNode::NON, DataValueNode::DOUBLE, DataValueNode::SINGLE, DataValueNode::SEMICOLON, DataValueNode::FRAMECODE
 o setDelimType
 public void setDelimType(short delim) throws BadValueForDelimiter
Sets the delimiter type of the value in this item. Note that no checks are done to ensure that the delimiter type given is valid for the string in this class.

Throws: BadValueForDelimiter
if the value for the node won't be valid syntax given the kind of delimiter the node has.
See Also:
DataValueNode::NON, DataValueNode::DOUBLE, DataValueNode::SINGLE, DataValueNode::SEMICOLON, DataValueNode::FRAMECODE
 o getValue
 public String getValue()
Gets the String value of this item.

 o getValueNode
 public DataValueNode getValueNode()
getValueNode() is like getValue(), but it returns the whole DataValueNode, not just the string inside it.

Returns:
the DataValueNode inside this item
 o setValue
 public void setValue(String val) throws BadValueForDelimiter
Sets the string value of this item.

Throws: BadValueForDelimiter
if the value for the node won't be valid syntax given the kind of delimiter the node has.
 o setValue
 public void setValue(String val,
                      short delim) throws BadValueForDelimiter
Sets the String value and delimiter of this item together.

Throws: BadValueForDelimiter
if the value for the node won't be valid syntax given the kind of delimiter the node has.
 o getLabel
 public String getLabel()
Gets the String tag name of this item.

 o getNameNode
 public DataNameNode getNameNode()
Gets the entire DataNameNode inside this item (as opposed to just the string name like getLabel() does.)

Returns:
the DataNameNode
 o setLabel
 public void setLabel(String name) throws NameViolatesStarSyntax
Sets the String tag name of this item - it's an exception if the name does not begin with an underscore.

Throws: BadValueForDelimiter
if the value for the node won't be valid syntax given the kind of delimiter the node has.
 o searchByName
 public VectorCheckType searchByName(String searchFor)
Included for orthogonality with StarNode. Not really very useful at this scope. The search for names is case insensitive

Overrides:
searchByName in class StarNode
 o searchByTagValue
 public VectorCheckType searchByTagValue(String tag,
                                         String value)
Included for orthogonality with StarNode. Not really very useful at this scope. The search for names is case insensitive, but the search for values is case-sensitive.

Overrides:
searchByTagValue in class StarNode
 o searchForType
 public VectorCheckType searchForType(Class type,
                                      short delim)
Included for orthogonality with StarNode. Not really very useful at this scope.

Overrides:
searchForType in class StarNode
 o Unparse
 public void Unparse(int indent)
Unparse prints the contents of the StarNode object out to the given stream. This is essentially the inverse of the CS term to "parse", hence the name "Unparse". The parameter given is the indentation level to print things.

Overrides:
Unparse in class StarNode

All Packages  Class Hierarchy  This Package  Previous  Next  Index