|
|||||||||
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.DataLoopNode
A DataLoopNode holds one loop from the Star file tree. The loop can be nested. A DataLoopNode is mostly just a pairing of a LoopTableNode with its associated DataLoopNameListNode. Most of the interesting methods are contained in one of those two types.
Field Summary | |
protected DataLoopNameListNode |
myNames
|
protected LoopTableNode |
myVals
|
protected boolean |
parseMismatchFlag
|
Fields inherited from class EDU.bmrb.starlibj.StarNode |
colNum, lineNum, parent, preComment |
Constructor Summary | |
DataLoopNode()
constructor - makes empty DataLoopNode. |
|
DataLoopNode(boolean tab)
constructor - makes a loop with the given tabulation setting. |
|
DataLoopNode(boolean tab,
boolean indent,
int rowsPerLine)
constructor - makes a loop with the given settings. |
|
DataLoopNode(DataLoopNameListNode names,
LoopTableNode table)
Constructor, given the name list and table. |
|
DataLoopNode(DataLoopNode copyMe)
copy constructor - deep copy. |
Method Summary | |
java.lang.Object |
clone()
clone - allocate a copy of me and return it |
DataLoopNameListNode |
getNames()
return a reference to the DataLoopNameList of names in me. |
boolean |
getTabFlag()
Get the tabulation flag for this loop: |
LoopTableNode |
getVals()
return a reference to the LoopTableNode of values in me. |
VectorCheckType |
searchByName(java.lang.String searchFor)
searchByName() will generate a list of all the places a particular name exists in this Star object. |
VectorCheckType |
searchByTagValue(java.lang.String tag,
java.lang.String value)
Given a tag name and a value, find the DataValueNodes from inside this loop that match the criteria. |
VectorCheckType |
searchForType(java.lang.Class type,
short delim)
This method returns a vector of all the nodes of the given type. |
void |
setTabFlag(boolean fl)
Set the tabulation flag for this loop: |
Methods inherited from class EDU.bmrb.starlibj.StarNode |
getColNum, getLineNum, getParallelCopy, getParent, getPreComment, searchForTypeByName, searchForTypeByTagValue, setColNum, setLineNum, setParent, setPeer, setPreComment, Unparse |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DataLoopNameListNode myNames
protected LoopTableNode myVals
protected boolean parseMismatchFlag
Constructor Detail |
public DataLoopNode()
public DataLoopNode(boolean tab)
tab
- true = loop will print tabularly, false = linearlypublic DataLoopNode(boolean tab, boolean indent, int rowsPerLine)
tab
- true = loop will print tabularly, false = linearlyindent
- true = loop body will be indented (normal), false = not indented.rowsPerLine
- integer number of rows printed in a line of text. Normally
you set it to 1.public DataLoopNode(DataLoopNameListNode names, LoopTableNode table)
public DataLoopNode(DataLoopNode copyMe)
Method Detail |
public java.lang.Object clone()
clone
in class StarNode
EDU.bmrb.starlibj.StarNode
StarFileNode
public LoopTableNode getVals()
public DataLoopNameListNode getNames()
public boolean getTabFlag()
public void setTabFlag(boolean fl)
fl
- the tab flag to set it to.public VectorCheckType searchByName(java.lang.String searchFor)
The returned results are DataNameNodes when looking in a DataLoopNode like this.
It should be noted that this algorithm, and the other search algorithms that follow, are simple linear searches with no indexing. So they are computationally slow. So far the need has not yet surfaced for a faster indexed search technique, although one could be added behind the scenes without changing the interface.
The search for names is case-insensitive.
searchByName
in class StarNode
searchFor
- the string name to look for.public VectorCheckType searchByTagValue(java.lang.String tag, java.lang.String value)
The search for tag names is case-insensitive.
The search for values, however is case-sensitive.
searchByTagValue
in class StarNode
tag
- - Look for this tag...value
- - Where it has this value.public VectorCheckType searchForType(java.lang.Class type, short delim)
The second parameter is optional and is only useful when you are searching for DataValueNodes. It determines the kind of DataValueNode you are searching for, by delimiter type. For example, you could search for only those DataValueNodes that are semicolon-delimited by passing DataValueNode::SEMICOLON as the second argument. Or you could look for just framecodes by passing DataValueNode::FRAMECODE as the second parameter. Passing a negative number says you want all the DataValueNodes, regardless of their delimiter type.
If the search is for some ASTtype other than DataValueNode, then it is irrelevant what the second parameter of this function is, as it will never be used - You can just leave it off and accept the default.
searchForType
in class StarNode
type
- - type to search fordelim
- - DataValueNode::ValType to look for. Default = "dont-care".
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |