All Packages Class Hierarchy This Package Previous Next Index
Class EDU.bmrb.starlibj.LoopRowNode
java.lang.Object
|
+----EDU.bmrb.starlibj.StarNode
|
+----EDU.bmrb.starlibj.LoopRowNode
- public class LoopRowNode
- extends StarNode
- implements Cloneable
A LoopRowNode is a single tuple of values for a loop, like
a 'row' in a table. It behaves like a VectorCheckType class,
implementing most of the same API as VectorCheckType.
- See Also:
- VectorCheckType
-
LoopRowNode()
- Default constructor
-
LoopRowNode(LoopRowNode)
- copy constructor
-
addElement(DataValueNode)
- Just like the Vector method of the same name,
but It will refuse to work if this row is already inside
a DataLoopNode, and it will generate an exception.
-
capacity()
- Return the max number of characters that this row can hold
before it needs to allocate a bigger chunk of heap memory.
-
clone()
- clone - make a deep copy of me and return a reference to it.
-
elementAt(int)
- Just like the Vector method of the same name.
-
ensureCapacity(int)
- Enlarge capacity of the stringbuffer so that it can
hold newCap characters.
-
firstElement()
- Just like the Vector method of the same name.
-
getInnerLoop()
- Returns a reference to the inner loop that is under this
row.
-
insertElementAt(DataValueNode, int)
- Just like the Vector method of the same name,
but It will refuse to work if this row is already inside
a DataLoopNode, and it will generate an exception.
-
isEmpty()
- Just like the Vector method of the same name.
-
lastElement()
- Just like the Vector method of the same name.
-
removeElementAt(int)
- Similar to the Vector method of the same name, however
It will refuse to work if this row is already inside a
DataLoopNode, and it will generate an exception.
-
removeInnerLoop()
- De-links the inner loop from this row.
-
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.
-
setElementAt(DataValueNode, int)
- Just like the Vector method of the same name.
-
setInnerLoop(LoopTableNode)
- Allows the user to set the inner loop under this row.
-
size()
- Just like the Vector method of the same name.
-
Unparse(int)
- Unparse prints the contents of the StarNode object out to the
given stream.
LoopRowNode
public LoopRowNode()
- Default constructor
LoopRowNode
public LoopRowNode(LoopRowNode copyMe)
- copy constructor
clone
public Object clone()
- clone - make a deep copy of me and return a reference to it.
- Overrides:
- clone in class StarNode
ensureCapacity
public void ensureCapacity(int newCap)
- Enlarge capacity of the stringbuffer so that it can
hold newCap characters. This is not necessary to
call this method, but if you know roughly how many
total characters will be in a row of values ahead of time,
calling this method can make things run a bit faster.
capacity
public int capacity()
- Return the max number of characters that this row can hold
before it needs to allocate a bigger chunk of heap memory.
This is not a hard limit - if it needs to it will expand this
number. It is just here for help with performance tuning.
(Using this you can know when to manually expand the memory
when you wish instead of relying on the library to do it
when the string runs out of room.)
Example:
if( numberOfCharactersIKnowINeed > row.capacity() )
row.ensureCapacity( numberOfCharactersIKnowINeed );
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
elementAt
public DataValueNode elementAt(int index)
- Just like the Vector method of the same name.
- See Also:
- elementAt
firstElement
public DataValueNode firstElement()
- Just like the Vector method of the same name.
- See Also:
- firstElement
lastElement
public DataValueNode lastElement()
- Just like the Vector method of the same name.
- See Also:
- lastElement
setElementAt
public void setElementAt(DataValueNode val,
int index)
- Just like the Vector method of the same name.
- See Also:
- setElementAt
removeElementAt
public void removeElementAt(int index) throws OperationCausesMismatchedLoopData
- Similar to the Vector method of the same name, however
It will refuse to work if this row is already inside a
DataLoopNode, and it will generate an exception.
- See Also:
- removeElementAt
insertElementAt
public void insertElementAt(DataValueNode val,
int index) throws OperationCausesMismatchedLoopData
- Just like the Vector method of the same name,
but It will refuse to work if this row is already inside
a DataLoopNode, and it will generate an exception.
- See Also:
- insertElementAt
addElement
public void addElement(DataValueNode val) throws OperationCausesMismatchedLoopData
- Just like the Vector method of the same name,
but It will refuse to work if this row is already inside
a DataLoopNode, and it will generate an exception.
- See Also:
- addElement
getInnerLoop
public LoopTableNode getInnerLoop()
- Returns a reference to the inner loop that is under this
row. This will return nil if there is no inner loop under
this row.
- Returns:
- null if no inner loop.
setInnerLoop
public void setInnerLoop(LoopTableNode l) throws OperationCausesMismatchedLoopData
- Allows the user to set the inner loop under this row.
(TODO: need to throw exceptions here. Not implemented
yet, just a placeholder.)
- Throws: OperationCausesMismatchedLoopData
- when the new row
does not match the tagnames for this loop. If this row is not
in a loop yet, then this check is not performed, obviously.
removeInnerLoop
public void removeInnerLoop()
- De-links the inner loop from this row.
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
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