All Packages Class Hierarchy This Package Previous Next Index
Class EDU.bmrb.starlibj.LoopTableNode
java.lang.Object
|
+----EDU.bmrb.starlibj.StarNode
|
+----EDU.bmrb.starlibj.LoopTableNode
- public class LoopTableNode
- extends StarNode
- implements Cloneable
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.
-
myIndentFlag
-
-
myRows
-
-
myRowsPerLine
-
-
myTabFlag
-
-
LoopTableNode()
- default constructor - makes a loop with indent, linear.
-
LoopTableNode(boolean)
-
-
LoopTableNode(boolean, boolean, int)
-
-
LoopTableNode(LoopTableNode)
- copy constructor - deep copy.
-
addElement(LoopRowNode)
- Just like the Vector method of the same name,
but it will throw an exception when invalid insertions
are attempted.
-
calcPrintSizes(Vector, Vector)
- Calcualte the sizes to print this table in.
-
capacity()
- Just like the Vector method of the same name.
-
clone()
- clone - make a deep copy of me and return a reference to it.
-
contains(LoopRowNode)
- Just like the Vector method of the same name.
-
elementAt(int)
- Just like the Vector method of the same name.
-
elements()
- Just like the Vector method of the same name.
-
firstElement()
- Just like the Vector method of the same name.
-
getIndentFlag()
- Gets the indentation Unparse flag for this table.
-
getMaxDepth()
-
-
getMyDepth()
-
-
getRowsPerLine()
- Gets the number of rows to be Unparsed on one line when in
tabular mode.
-
getTabFlag()
- Gets the tabulation Unparse flag for this table.
-
indexOf(LoopRowNode)
- Just like the Vector method of the same name.
-
indexOf(LoopRowNode, int)
- Just like the Vector method of the same name.
-
insertElementAt(LoopRowNode, int)
- Just like the Vector method of the same name,
but it will throw an exception when invalid insertions
are attempted.
-
isEmpty()
- Just like the Vector method of the same name.
-
isInLoop()
- isInLoop: Returns true if this LoopTableNode is inside a DataLoopNode,
or false if it is not.
-
lastElement()
- Just like the Vector method of the same name.
-
lastIndexOf(LoopRowNode)
- Just like the Vector method of the same name.
-
lastIndexOf(LoopRowNode, int)
- Just like the Vector method of the same name.
-
removeElement(LoopRowNode)
- Just like the Vector method of the same name, but
it makes this table go away if the row removed was the
last one.
-
removeElementAt(int)
- Similar to the Vector method of the same name.
-
searchForType(Class)
- 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.
-
searchForType(Class, short)
- Find the type given in this row - Return all the matching
values that meet the criteria given in the parameters.
-
searchForValsInColumn(int, int, String)
- Look for the value in the nest level/column given.
-
setElementAt(LoopRowNode, int)
- 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.
-
setIndentFlag(boolean)
- Sets the indentation Unparse flag for this table.
-
setRowsPerLine(int)
- Sets the number of rows Unparsed per line when in tabular mode.
-
setSize(int)
- Just like the Vector method of the same name.
-
setTabFlag(boolean)
- Sets the tabulation Unparse flag for this table.
-
size()
- Just like the Vector method of the same name.
-
truncateNestLevel(int)
-
-
Unparse(int)
- Unparse prints the contents of the StarNode object out to the
given stream.
myTabFlag
protected boolean myTabFlag
myRows
protected LoopRowsVector myRows
myIndentFlag
protected boolean myIndentFlag
myRowsPerLine
protected int myRowsPerLine
LoopTableNode
public LoopTableNode()
- default constructor - makes a loop with indent, linear.
LoopTableNode
public LoopTableNode(boolean tabFlag)
- Parameters:
- 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.
LoopTableNode
public LoopTableNode(boolean tabFlag,
boolean indentFl,
int rowsPerLn)
- Parameters:
- 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.
LoopTableNode
public LoopTableNode(LoopTableNode copyMe)
- copy constructor - deep copy.
clone
public Object clone()
- clone - make a deep copy of me and return a reference to it.
- Overrides:
- clone in class StarNode
setSize
public void setSize(int newSize)
- Just like the Vector method of the same name.
- See Also:
- setSize
capacity
public int capacity()
- Just like the Vector method of the same name.
- See Also:
- capacity
size
public int size()
- Just like the Vector method of the same name.
- See Also:
- size
isEmpty
public boolean isEmpty()
- Just like the Vector method of the same name.
- See Also:
- isEmpty
elements
public Enumeration elements()
- Just like the Vector method of the same name.
- See Also:
- Enumeration
contains
public boolean contains(LoopRowNode row)
- Just like the Vector method of the same name.
- See Also:
- contains
indexOf
public int indexOf(LoopRowNode val)
- Just like the Vector method of the same name.
- See Also:
- indexOf
indexOf
public int indexOf(LoopRowNode row,
int index)
- Just like the Vector method of the same name.
- See Also:
- indexOf
lastIndexOf
public int lastIndexOf(LoopRowNode row)
- Just like the Vector method of the same name.
- See Also:
- lastIndexOf
lastIndexOf
public int lastIndexOf(LoopRowNode row,
int index)
- Just like the Vector method of the same name.
- See Also:
- lastIndexOf
elementAt
public LoopRowNode elementAt(int index)
- Just like the Vector method of the same name.
- See Also:
- elementAt
firstElement
public LoopRowNode firstElement()
- Just like the Vector method of the same name.
- See Also:
- firstElement
lastElement
public LoopRowNode lastElement()
- Just like the Vector method of the same name.
- See Also:
- lastElement
setElementAt
public void setElementAt(LoopRowNode row,
int index) throws OperationCausesMismatchedLoopData
- 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. (If this table is not
inside a DataLoopNode, then this exception is never thrown.
- See Also:
- setElementAt
removeElementAt
public void removeElementAt(int index)
- Similar to the Vector method of the same name.
If this is the last row in te 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.)
- See Also:
- removeElementAt
insertElementAt
public 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.
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.)
- See Also:
- insertElementAt
addElement
public void addElement(LoopRowNode row)
- Just like the Vector method of the same name,
but it will throw an exception when invalid insertions
are attempted.
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.)
- See Also:
- addElement
removeElement
public 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.
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.)
- See Also:
- removeElement
isInLoop
public int isInLoop()
- isInLoop: Returns true if this LoopTableNode is inside a DataLoopNode,
or false if it is not. (In a complete STAR tree it is always true,
but when building up a loop piece by piece an LoopTableNode might not
have been attached to a loop yet.)
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).
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
setTabFlag
public void setTabFlag(boolean tabFlag)
- Sets the tabulation Unparse flag for this table.
- Parameters:
- tabFlag - true for tabular, false for linear.
getTabFlag
public boolean getTabFlag()
- Gets the tabulation Unparse flag for this table.
- Returns:
- true = tabular, false = linear
setIndentFlag
public void setIndentFlag(boolean tabFlag)
- Sets the indentation Unparse flag for this table.
- Parameters:
- tabFlag - true for indented from margin (norma),
false for up-against-margin.
getIndentFlag
public boolean getIndentFlag()
- Gets the indentation Unparse flag for this table.
- Returns:
- true for indented from margin (norma),
false for up-against-margin.
setRowsPerLine
public void setRowsPerLine(int setTo)
- Sets the number of rows Unparsed per line when in tabular mode.
if getIndentFlag() is false, then this is
meaningless.
- Parameters:
- setTo - the number of rows per line.
getRowsPerLine
public int getRowsPerLine()
- Gets the number of rows to be Unparsed on one line when in
tabular mode.
- Returns:
- the number of rows per line.
searchForType
public VectorCheckType searchForType(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.
- Parameters:
- type - look for this type.
searchForType
public VectorCheckType searchForType(Class type,
short delim)
- Find the type given in this row - Return all the matching
values that meet the criteria given in the parameters.
- Parameters:
- type - look for this type
- delim - Look for this delimiter type.
- Overrides:
- searchForType in class StarNode
- See Also:
- DataValueNode::NON
getMyDepth
protected int getMyDepth()
getMaxDepth
protected int getMaxDepth()
truncateNestLevel
protected void truncateNestLevel(int depth)
searchForValsInColumn
protected VectorCheckType searchForValsInColumn(int searchNest,
int searchCol,
String value)
- Look for the value in the nest level/column given.
nest level and column both start counting at zero.
calcPrintSizes
protected void calcPrintSizes(Vector preSizes,
Vector postSizes)
- Calcualte the sizes to print this table in.
All Packages Class Hierarchy This Package Previous Next Index