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.
-
LoopNameListNode()
- empty constructor
-
LoopNameListNode(LoopNameListNode)
- copy constructor
-
addElement(Object)
- Just like the Vector method of the same name.
-
addElement(Object, DataValueNode)
- Just like the Vector method of the same name.
-
clone()
- From interface Cloneable.
-
contains(Object)
- 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.
-
getDepth()
- Get the depth of this name list in the loop it is in.
-
getLabel()
- Returns the name of the first tag in the list, which is sometimes
used to refer to the whole loop list.
-
indexOf(Object)
- Just like the Vector method of the same name.
-
indexOf(Object, int)
- Just like the Vector method of the same name.
-
insertElementAt(Object, int)
- Just like the Vector method of the same name.
-
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 ('.')
-
isEmpty()
- Just like the Vector method of the same name.
-
lastElement()
- Just like the Vector method of the same name.
-
lastIndexOf(Object)
- Just like the Vector method of the same name.
-
lastIndexOf(Object, int)
- Just like the Vector method of the same name.
-
removeElement(Object)
- Just like the Vector method of the same name.
-
removeElementAt(int)
- Similar to the Vector method of the same name.
-
searchByName(String)
- Find the name given in this name list.
-
searchForType(Class)
- Find the type given in this name list.
-
setElementAt(Object, int)
- Just like the Vector method of the same name.
-
setSize(int)
- Just like the Vector method of the same name.
-
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.
LoopNameListNode
public LoopNameListNode()
- empty constructor
LoopNameListNode
public LoopNameListNode(LoopNameListNode copyMe)
- copy constructor
clone
public Object clone()
- From interface Cloneable.
- Overrides:
- clone in class StarNode
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
size
public int size()
- Just like the Vector method of the same name.
Returns the number of names in this list
- See Also:
- size
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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.
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
searchForType
public VectorCheckType searchForType(Class type)
- Find the type given in this name list.
- Parameters:
- searchFor - look for this tag name.
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