|
|||||||||
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.LoopTableNode
A LoopTableNode is a 'table' of values in a loop. It is a vector of LoopRowNodes. Every DataLoopNode has at least one LoopTableNode for the outermost loop. Each nested subtable is represented by another LoopTableNode.
It is possible for a LoopRowNode to contain a LoopTableNode under it. This is how nested loops are linked together. At the outermost level, there is a LoopTableNode containing LoopRowNodes. Each of these LoopRowNodes could have a LoopTableNode under it, which in turn is a collection of LoopRowNodes which could have LoopTableNodes under them, and so on.
Field Summary | |
protected boolean |
myIndentFlag
|
protected LoopRowsVector |
myRows
|
protected int |
myRowsPerLine
|
protected boolean |
myTabFlag
|
Fields inherited from class EDU.bmrb.starlibj.StarNode |
colNum, lineNum, parent, preComment |
Constructor Summary | |
LoopTableNode()
default constructor - makes a loop with indent, linear. |
|
LoopTableNode(boolean tabFlag)
|
|
LoopTableNode(boolean tabFlag,
boolean indentFl,
int rowsPerLn)
|
|
LoopTableNode(LoopTableNode copyMe)
copy constructor - deep copy. |
Method Summary | |
void |
addElement(LoopRowNode row)
Just like the Vector method of the same name, but it will throw an exception when invalid insertions are attempted. |
protected void |
calcPrintSizes(java.util.Vector preSizes,
java.util.Vector postSizes)
Calcualte the sizes to print this table in. |
int |
capacity()
Just like the Vector method of the same name. |
java.lang.Object |
clone()
clone - make a deep copy of me and return a reference to it. |
boolean |
contains(LoopRowNode row)
Just like the Vector method of the same name. |
LoopRowNode |
elementAt(int index)
Just like the Vector method of the same name. |
java.util.Enumeration |
elements()
Just like the Vector method of the same name. |
LoopRowNode |
firstElement()
Just like the Vector method of the same name. |
boolean |
getIndentFlag()
Gets the indentation Unparse flag for this table. |
protected int |
getMaxDepth()
|
protected int |
getMyDepth()
|
int |
getRowsPerLine()
Gets the number of rows to be Unparsed on one line when in tabular mode. |
boolean |
getTabFlag()
Gets the tabulation Unparse flag for this table. |
int |
indexOf(LoopRowNode val)
Just like the Vector method of the same name. |
int |
indexOf(LoopRowNode row,
int index)
Just like the Vector method of the same name. |
void |
insertElementAt(LoopRowNode row,
int index)
Just like the Vector method of the same name, but it will throw an exception when invalid insertions are attempted. |
boolean |
isEmpty()
Just like the Vector method of the same name. |
int |
isInLoop()
isInLoop: Returns true if this LoopTableNode is inside a DataLoopNode, or false if it is not. |
LoopRowNode |
lastElement()
Just like the Vector method of the same name. |
int |
lastIndexOf(LoopRowNode row)
Just like the Vector method of the same name. |
int |
lastIndexOf(LoopRowNode row,
int index)
Just like the Vector method of the same name. |
boolean |
removeElement(LoopRowNode row)
Just like the Vector method of the same name, but it makes this table go away if the row removed was the last one. |
void |
removeElementAt(int index)
Similar to the Vector method of the same name. |
VectorCheckType |
searchForType(java.lang.Class type)
Find all values of the type given in this table - this is fairly nonsensical because all values in the table are of type DataValueNode, but this function is here for orthogonality with the base class StarNode. |
VectorCheckType |
searchForType(java.lang.Class type,
short delim)
Find the type given in this row - Return all the matching values that meet the criteria given in the parameters. |
protected VectorCheckType |
searchForValsInColumn(int searchNest,
int searchCol,
java.lang.String value)
Look for the value in the nest level/column given. |
void |
setElementAt(LoopRowNode row,
int index)
Just like the Vector method of the same name, except that it throws an exception if the number of values in the row is incorrect for the number of names in the list of names in this DataLoopNode. |
void |
setIndentFlag(boolean tabFlag)
Sets the indentation Unparse flag for this table. |
void |
setRowsPerLine(int setTo)
Sets the number of rows Unparsed per line when in tabular mode. |
void |
setSize(int newSize)
Just like the Vector method of the same name. |
void |
setTabFlag(boolean tabFlag)
Sets the tabulation Unparse flag for this table. |
int |
size()
Just like the Vector method of the same name. |
protected void |
truncateNestLevel(int depth)
|
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, 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 |
protected boolean myTabFlag
protected LoopRowsVector myRows
protected boolean myIndentFlag
protected int myRowsPerLine
Constructor Detail |
public LoopTableNode()
public LoopTableNode(boolean tabFlag)
tabFlag
- set to true for a tabularly printed loop, or false
for a linearly printed loop. This only affects output with
Unparse() and nothing else.public LoopTableNode(boolean tabFlag, boolean indentFl, int rowsPerLn)
tabFlag
- set to true for a tabularly printed loop, or false
for a linearly printed loop. This only affects output with
Unparse() and nothing else.indentFl
- set to true if this loop should be output indented.rowsPerLn
- set to the number of rows to include on one
line of text. Only has meaning if tabFlag is true.public LoopTableNode(LoopTableNode copyMe)
Method Detail |
public java.lang.Object clone()
clone
in class StarNode
EDU.bmrb.starlibj.StarNode
StarFileNode
public void setSize(int newSize)
VectorCheckType.setSize
public int capacity()
VectorCheckType.capacity
public int size()
VectorCheckType.size
public boolean isEmpty()
VectorCheckType.isEmpty
public java.util.Enumeration elements()
VectorCheckType.Enumeration
public boolean contains(LoopRowNode row)
VectorCheckType.contains
public int indexOf(LoopRowNode val)
VectorCheckType.indexOf
public int indexOf(LoopRowNode row, int index)
VectorCheckType.indexOf
public int lastIndexOf(LoopRowNode row)
VectorCheckType.lastIndexOf
public int lastIndexOf(LoopRowNode row, int index)
VectorCheckType.lastIndexOf
public LoopRowNode elementAt(int index)
VectorCheckType.elementAt
public LoopRowNode firstElement()
VectorCheckType.firstElement
public LoopRowNode lastElement()
VectorCheckType.lastElement
public void setElementAt(LoopRowNode row, int index) throws OperationCausesMismatchedLoopData
VectorCheckType.setElementAt
public void removeElementAt(int index)
VectorCheckType.removeElementAt
public void insertElementAt(LoopRowNode row, int index)
An invalid insertion is one with the following conditions:
1 - This table is already inside a DataLoopNode (and not
'free floating'.), and
2 - The row being inserted has the wrong number of values.
(The number of values in the row must match the number of names
in the loop header.)
VectorCheckType.insertElementAt
public void addElement(LoopRowNode row)
An invalid insertion is one with the following conditions:
1 - This table is already inside a DataLoopNode (and not
'free floating'.), and
2 - The row being inserted has the wrong number of values.
(The number of values in the row must match the number of names
in the loop header.)
VectorCheckType.addElement
public boolean removeElement(LoopRowNode row)
If this is the last row in the table, and if this table is nested inside a LoopRowNode, then it will unlink itself from the parent LoopRowNode (which should make this table go away at garbage collection time.)
VectorCheckType.removeElement
public int isInLoop()
The value returned is an integer. It is a count of how many nesting levels deep this is in the loop that it was found it. Thus if it is zero (false) it was not found in a loop, and if it is 1 then it was found in nesting level 1 of a loop, 2 = nesting level 2, etc.
Note that this is off-by-one with the index used in the [] operator, which starts counting at zero. This was done so that this method could be used like a boolean. (zero means not found, nonzero means found).
public void Unparse(int indent)
Unparse
in class StarNode
public void setTabFlag(boolean tabFlag)
tabFlag
- true for tabular, false for linear.public boolean getTabFlag()
public void setIndentFlag(boolean tabFlag)
tabFlag
- true for indented from margin (norma),
false for up-against-margin.public boolean getIndentFlag()
public void setRowsPerLine(int setTo)
setTo
- the number of rows per line.public int getRowsPerLine()
public VectorCheckType searchForType(java.lang.Class type)
type
- look for this type.public VectorCheckType searchForType(java.lang.Class type, short delim)
searchForType
in class StarNode
type
- look for this typedelim
- Look for this delimiter type.protected int getMyDepth()
protected int getMaxDepth()
protected void truncateNestLevel(int depth)
protected VectorCheckType searchForValsInColumn(int searchNest, int searchCol, java.lang.String value)
protected void calcPrintSizes(java.util.Vector preSizes, java.util.Vector postSizes)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |