All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.bmrb.starlibj.LoopNameListNode

java.lang.Object
   |
   +----EDU.bmrb.starlibj.StarNode
           |
           +----EDU.bmrb.starlibj.LoopNameListNode

public class LoopNameListNode
extends StarNode
implements Cloneable
Holds the list of tag names that represents one nesting level of the loop.

To keep the API familiar to the user, I have tried to mimic the methods in java.util.vector as closely as possible.


Constructor Index

 o LoopNameListNode()
empty constructor
 o LoopNameListNode(LoopNameListNode)
copy constructor

Method Index

 o addElement(Object)
Just like the Vector method of the same name.
 o addElement(Object, DataValueNode)
Just like the Vector method of the same name.
 o clone()
From interface Cloneable.
 o contains(Object)
Just like the Vector method of the same name.
 o elementAt(int)
Just like the Vector method of the same name.
 o elements()
Just like the Vector method of the same name.
 o firstElement()
Just like the Vector method of the same name.
 o getDepth()
Get the depth of this name list in the loop it is in.
 o getLabel()
Returns the name of the first tag in the list, which is sometimes used to refer to the whole loop list.
 o indexOf(Object)
Just like the Vector method of the same name.
 o indexOf(Object, int)
Just like the Vector method of the same name.
 o insertElementAt(Object, int)
Just like the Vector method of the same name.
 o insertElementAt(Object, int, DataValueNode)
Identical to the version above, except that the value to be padded into the loop values is chosen by the caller instead of being a dot ('.')
 o isEmpty()
Just like the Vector method of the same name.
 o lastElement()
Just like the Vector method of the same name.
 o lastIndexOf(Object)
Just like the Vector method of the same name.
 o lastIndexOf(Object, int)
Just like the Vector method of the same name.
 o removeElement(Object)
Just like the Vector method of the same name.
 o removeElementAt(int)
Similar to the Vector method of the same name.
 o searchByName(String)
Find the name given in this name list.
 o searchForType(Class)
Find the type given in this name list.
 o setElementAt(Object, int)
Just like the Vector method of the same name.
 o setSize(int)
Just like the Vector method of the same name.
 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 LoopNameListNode
 public LoopNameListNode()
empty constructor

 o LoopNameListNode
 public LoopNameListNode(LoopNameListNode copyMe)
copy constructor

Methods

 o clone
 public Object clone()
From interface Cloneable.

Overrides:
clone in class StarNode
 o setSize
 public void setSize(int newSize)
Just like the Vector method of the same name. Makes enough room so that there can be newSize elements in the node, without having to insert them manually one at a time. The nodes start out will a null value that can be replaced with setElementAt.

See Also:
setSize
 o size
 public int size()
Just like the Vector method of the same name. Returns the number of names in this list

See Also:
size
 o isEmpty
 public boolean isEmpty()
Just like the Vector method of the same name. True if this list has no names in it.

See Also:
isEmpty
 o elements
 public Enumeration elements()
Just like the Vector method of the same name. Gives an enumeration over the names in this block.

See Also:
Enumeration
 o contains
 public boolean contains(Object obj)
Just like the Vector method of the same name. True if the node given is in this name list.

Parameters:
obj - The string name.
See Also:
contains
 o indexOf
 public int indexOf(Object obj)
Just like the Vector method of the same name. Returns the integer index of the given name inside this list.

Parameters:
obj - The name to look for.
See Also:
indexOf
 o indexOf
 public int indexOf(Object obj,
                    int index)
Just like the Vector method of the same name. Returns the integer index of the next occurrance of the given name afterthe given index.

Parameters:
obj - The name to look for.
index - Start searching at this point in the vector.
See Also:
indexOf
 o lastIndexOf
 public int lastIndexOf(Object obj)
Just like the Vector method of the same name. Returns the lastmost integer index of the given name

Parameters:
obj - The name to look for.
See Also:
lastIndexOf
 o lastIndexOf
 public int lastIndexOf(Object obj,
                        int index)
Just like the Vector method of the same name. Returns the lastmost integer index of the given name, but going no higher than the given index.

Parameters:
obj - The name to look for.
index - Start searching back from this point in the vector.
See Also:
lastIndexOf
 o elementAt
 public DataNameNode elementAt(int index)
Just like the Vector method of the same name. Returns the name object at the given index.

Parameters:
index - The index to return the name for.
Returns:
The returned object is a string.
See Also:
elementAt
 o firstElement
 public DataNameNode firstElement()
Just like the Vector method of the same name. Returns the first name in the list

Returns:
The returned object is a string.
See Also:
firstElement
 o lastElement
 public DataNameNode lastElement()
Just like the Vector method of the same name. Returns the last name in the list.

Returns:
The returned object is a string.
See Also:
lastElement
 o setElementAt
 public void setElementAt(Object obj,
                          int index) throws WrongElementType
Just like the Vector method of the same name. Clobbers the name at the index given with the new name.

Parameters:
obj - The name to replace it with.
index - the position to replace.
See Also:
setElementAt
 o removeElementAt
 public void removeElementAt(int index)
Similar to the Vector method of the same name. Deletes the name. If this is contained inside a DataLoopNode, then it also removes all the values from the associated loop table that are under this name.

Parameters:
index - the position to remove.
See Also:
removeElementAt
 o insertElementAt
 public void insertElementAt(Object obj,
                             int index) throws WrongElementType
Just like the Vector method of the same name. Inserts a name just in front of the index given.. If this is in a DataLoopNode, it also inserts all the appropriate columns into the data below so that it matches the newly inserted name. The new values will all be star nulls (single dot '.' values).

Parameters:
obj - The name to insert.
index - the position to insert it in from of.
See Also:
insertElementAt
 o insertElementAt
 public void insertElementAt(Object obj,
                             int index,
                             DataValueNode val) throws WrongElementType
Identical to the version above, except that the value to be padded into the loop values is chosen by the caller instead of being a dot ('.')

Parameters:
obj - The name to insert.
index - the position to insert it in from of.
val - The value to insert in the columns below.
See Also:
insertElementAt
 o addElement
 public void addElement(Object obj) throws WrongElementType
Just like the Vector method of the same name. Adds a name to the end of the list. Also adds a default value into the loop in a column to match up with the new name if the loop is there. The default value is a single nonquoted dot (.).

Parameters:
obj - The name to add.
See Also:
addElement
 o addElement
 public void addElement(Object obj,
                        DataValueNode val) throws WrongElementType
Just like the Vector method of the same name. Adds a name to the end of the list. Also adds new DataValueNodes into the loop in a column to match up with the new name where needed. The default value is the value passed in the parameter

Parameters:
obj - The name to add.
val - the new DataValueNode to copy from if need be.
See Also:
addElement
 o removeElement
 public void removeElement(Object obj)
Just like the Vector method of the same name. Removes the name matching the one given.

Parameters:
obj - (string) The name to remove.
See Also:
removeElement
 o getDepth
 public int getDepth()
Get the depth of this name list in the loop it is in. (The depth is the level of nesting. If this is the outermost list of names, it is at depth 'zero', if it is the next level in, is is depth 1, and so on...)
     loop_
         _tag1    # --.
         _tag2    #   |-- depth 0.
         _tag3    # --'
         loop_
             _tagA    # --- depth 1.
             loop_
                 _tagX    # --.__ depth 2.
                 _tagY    # --'
 

Returns:
depth - negative number if this is not inside a DataLoopNode.
 o getLabel
 public String getLabel()
Returns the name of the first tag in the list, which is sometimes used to refer to the whole loop list.

 o searchByName
 public VectorCheckType searchByName(String searchFor)
Find the name given in this name list.

The search for names is case-insensitive.

Parameters:
searchFor - look for this tag name.
Overrides:
searchByName in class StarNode
 o searchForType
 public VectorCheckType searchForType(Class type)
Find the type given in this name list.

Parameters:
searchFor - look for this tag name.
 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