|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.bmrb.starlibj.StarNode | +--EDU.bmrb.starlibj.DataValueNode
DataValueNode is the class that stores a single value from the STAR tree. It is used for both loop values and the values associated with tags outside of loops. Making this a class instead of just a string allows for the handling of the delimiter type.
Field Summary | |
protected short |
delimType
|
static short |
DONT_CARE
delimiter type that indicates that you don't care about the delimiter type - only used for searches such as searchForType() |
static short |
DOUBLE
delimiter type that indicates that this is a doublequoted value (") |
static short |
FRAMECODE
delimiter type that indicates that this is a framecode value |
protected java.lang.String |
myStrVal
|
static short |
NON
delimiter type that indicates that this is a nonquoted value. |
static short |
SEMICOLON
delimiter type that indicates that this is semicolon demilited (;) |
static short |
SINGLE
delimiter type that indicates that this is a singlequoted value (') |
Fields inherited from class EDU.bmrb.starlibj.StarNode |
colNum, lineNum, parent, preComment |
Constructor Summary | |
DataValueNode(DataValueNode copyMe)
Constructor - copy another DataValueNode. |
|
DataValueNode(java.lang.String str)
Constructor - all DataValueNodes must have a string value, so no provisions are made for a 'default' no-args constructor. |
|
DataValueNode(java.lang.String str,
short delim)
Constructor - all DataValueNodes must have a string value, so no provisions are made for a 'default' no-args constructor. |
Method Summary | |
java.lang.Object |
clone()
Allocates a new copy of me and returns a reference to it. |
short |
getDelimType()
Returns the delimiter type of this value. |
java.lang.String |
getLabel()
Alias for getValue |
java.lang.String |
getValue()
Returns the string containing the value of this node. |
int |
myLongestStr()
Useful for printing. |
void |
setDelimType(short setTo)
Sets the delimiter type of this value. |
void |
setValue(java.lang.String newVal)
Sets the string value for this node. |
void |
setValue(java.lang.String newVal,
short newDelim)
Sets the string for this value, and the delimiter. |
void |
Unparse(int indent)
Unparse prints the contents of the StarNode object out to the given stream. |
Methods inherited from class EDU.bmrb.starlibj.StarNode |
getColNum, getLineNum, getParallelCopy, getParent, getPreComment, searchByName, searchByTagValue, searchForType, searchForTypeByName, searchForTypeByTagValue, setColNum, setLineNum, setParent, setPeer, setPreComment |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static short DONT_CARE
getDelimType
public static short NON
getDelimType
public static short DOUBLE
getDelimType
public static short SINGLE
getDelimType
public static short SEMICOLON
getDelimType
public static short FRAMECODE
getDelimType
protected java.lang.String myStrVal
protected short delimType
Constructor Detail |
public DataValueNode(java.lang.String str) throws BadValueForDelimiter
BadValueForDelimiter
- (Should theoretically never be
thrown, since a Semicolon string should accept any data and it
should at least be able to use a semicolon delimiter for
everything. If you ever see this exception, it indicates a
programming error within the starlibj itself.)public DataValueNode(java.lang.String str, short delim) throws BadValueForDelimiter
str
- The string to set the value to.delim
- The delimiter type to set the value to.public DataValueNode(DataValueNode copyMe)
Method Detail |
public short getDelimType()
public void setDelimType(short setTo) throws BadValueForDelimiter
BadValueForDelimiter
- Throws this exception if
the delimiter type is incorrect for the given type of string
(for example, if a string with whitespace is given a delimiter
type of "NON", that's an error.)public java.lang.String getValue()
public void setValue(java.lang.String newVal) throws BadValueForDelimiter
BadValueForDelimiter
- The string value is not
acceptable for the delimiter the value has. If you are
intending to change the delimiter too in the next statement,
try changing the delimiter *first*, or use the method to
change both at once setValAndDelimsetValAndDelim()
public void setValue(java.lang.String newVal, short newDelim) throws BadValueForDelimiter
BadValueForDelimiter
- The string value is not
acceptable for the delimiter given..public java.lang.Object clone()
clone
in class StarNode
EDU.bmrb.starlibj.StarNode
StarFileNode
public java.lang.String getLabel()
public void Unparse(int indent)
Unparse
in class StarNode
public int myLongestStr()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |