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

Constructor Index

 o LoopRowNode()
Default constructor
 o LoopRowNode(LoopRowNode)
copy constructor

Method Index

 o 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.
 o capacity()
Return the max number of characters that this row can hold before it needs to allocate a bigger chunk of heap memory.
 o clone()
clone - make a deep copy of me and return a reference to it.
 o elementAt(int)
Just like the Vector method of the same name.
 o ensureCapacity(int)
Enlarge capacity of the stringbuffer so that it can hold newCap characters.
 o firstElement()
Just like the Vector method of the same name.
 o getInnerLoop()
Returns a reference to the inner loop that is under this row.
 o 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.
 o isEmpty()
Just like the Vector method of the same name.
 o lastElement()
Just like the Vector method of the same name.
 o 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.
 o removeInnerLoop()
De-links the inner loop from this row.
 o 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.
 o searchForType(Class, short)
Find the type given in this row - Return all the matching values that meet the criteria given in the parameters.
 o setElementAt(DataValueNode, int)
Just like the Vector method of the same name.
 o setInnerLoop(LoopTableNode)
Allows the user to set the inner loop under this row.
 o size()
Just like the Vector method of the same name.
 o Unparse(int)
Unparse prints the contents of the StarNode object out to the given stream.

Constructors

 o LoopRowNode
 public LoopRowNode()
Default constructor

 o LoopRowNode
 public LoopRowNode(LoopRowNode copyMe)
copy constructor

Methods

 o clone
 public Object clone()
clone - make a deep copy of me and return a reference to it.

Overrides:
clone in class StarNode
 o 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.

 o 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 );
 

 o size
 public int size()
Just like the Vector method of the same name.

See Also:
size
 o isEmpty
 public boolean isEmpty()
Just like the Vector method of the same name.

See Also:
isEmpty
 o elementAt
 public DataValueNode elementAt(int index)
Just like the Vector method of the same name.

See Also:
elementAt
 o firstElement
 public DataValueNode firstElement()
Just like the Vector method of the same name.

See Also:
firstElement
 o lastElement
 public DataValueNode lastElement()
Just like the Vector method of the same name.

See Also:
lastElement
 o setElementAt
 public void setElementAt(DataValueNode val,
                          int index)
Just like the Vector method of the same name.

See Also:
setElementAt
 o 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
 o 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
 o 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
 o 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.
 o 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.
 o removeInnerLoop
 public void removeInnerLoop()
De-links the inner loop from this row.

 o 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.
 o 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
 o 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