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