|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.bmrb.starlibj.StarNode | +--EDU.bmrb.starlibj.SaveFrameNode
A SaveFrameNode contains the contents of a STAR file saveframe. It has a name, available through "getLabel()" and "setLabel()". This name must have a prefix of "save_". A SaveFrameNode behaves like a vector (it implements StarVectorLike) that can contain DataItemNodes and DataLoopNodes.
Field Summary | |
protected SaveListVector |
myDataList
|
protected java.lang.String |
myName
|
Fields inherited from class EDU.bmrb.starlibj.StarNode |
colNum, lineNum, parent, preComment |
Constructor Summary | |
SaveFrameNode(SaveFrameNode copyMe)
copy constructor - deep copy. |
|
SaveFrameNode(java.lang.String name)
constructor - Generates exception if the given saveframe name is not a legal saveframe name |
Method Summary | |
void |
addElement(java.lang.Object obj)
Just like the Vector method of the same name. |
java.lang.Object |
clone()
clone allocates a copy of me and returns a reference to it. |
boolean |
contains(java.lang.Object obj)
Just like the Vector method of the same name. |
StarNode |
elementAt(int index)
Just like the Vector method of the same name. |
java.util.Enumeration |
elements()
Just like the Vector method of the same name. |
StarNode |
firstElement()
Just like the Vector method of the same name. |
java.lang.String |
getLabel()
Gets the string name of this saveframe (save_whatever). |
int |
indexOf(java.lang.Object obj)
Just like the Vector method of the same name. |
int |
indexOf(java.lang.Object obj,
int index)
Just like the Vector method of the same name. |
void |
insertElementAt(java.lang.Object obj,
int index)
Just like the Vector method of the same name. |
boolean |
isEmpty()
Just like the Vector method of the same name. |
StarNode |
lastElement()
Just like the Vector method of the same name. |
int |
lastIndexOf(java.lang.Object obj)
Just like the Vector method of the same name. |
int |
lastIndexOf(java.lang.Object obj,
int index)
Just like the Vector method of the same name. |
boolean |
removeElement(java.lang.Object obj)
Just like the Vector method of the same name. |
void |
removeElementAt(int index)
Similar to the Vector method of the same name. |
VectorCheckType |
searchByName(java.lang.String searchFor)
Given a tag name, find the AST object it resides in. |
VectorCheckType |
searchByTagValue(java.lang.String tag,
java.lang.String value)
Given a tag name and a value, find the AST object that that particular tag and value pair resides in. |
VectorCheckType |
searchForType(java.lang.Class type,
short delim)
This method returns a vector of all the nodes of the given type. |
void |
setElementAt(java.lang.Object obj,
int index)
Just like the Vector method of the same name. |
void |
setLabel(java.lang.String newName)
Sets the string name of this saveframe - generates an exception if the name is invalid. |
void |
setSize(int newSize)
Just like the Vector method of the same name. |
int |
size()
Just like the Vector method of the same name. |
void |
Unparse(int indent)
Unparse prints the contents of the StarNode object out to the given stream. |
Methods inherited from class EDU.bmrb.starlibj.StarNode |
getColNum, getLineNum, getParallelCopy, getParent, getPreComment, searchForTypeByName, searchForTypeByTagValue, setColNum, setLineNum, setParent, setPeer, setPreComment |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String myName
protected SaveListVector myDataList
Constructor Detail |
public SaveFrameNode(java.lang.String name)
public SaveFrameNode(SaveFrameNode copyMe)
Method Detail |
public java.lang.Object clone()
clone
in class StarNode
EDU.bmrb.starlibj.StarNode
StarFileNode
public java.lang.String getLabel()
public void setLabel(java.lang.String newName) throws NameViolatesStarSyntax
public void setSize(int newSize)
VectorCheckType.setSize
public int size()
java.util.Vector.size
public boolean isEmpty()
java.util.Vector.isEmpty
public java.util.Enumeration elements()
java.util.Vector.Enumeration
public boolean contains(java.lang.Object obj)
obj
- The loop or item to look forjava.util.Vector.contains
public int indexOf(java.lang.Object obj)
obj
- The loop or item to look for.java.util.Vector.indexOf
public int indexOf(java.lang.Object obj, int index)
obj
- The item or loop to look for.index
- Start searching at this point in the vector.java.util.Vector.indexOf
public int lastIndexOf(java.lang.Object obj)
obj
- The item or loop to look for.java.util.Vector.lastIndexOf
public int lastIndexOf(java.lang.Object obj, int index)
obj
- The item or loop to look for.index
- Start searching back from this point in
the vector.java.util.Vector.lastIndexOf
public StarNode elementAt(int index)
index
- The index to return the item or loop at.java.util.Vector.elementAt
public StarNode firstElement()
java.util.Vector.firstElement
public StarNode lastElement()
java.util.Vector.lastElement
public void setElementAt(java.lang.Object obj, int index) throws WrongElementType
obj
- The item or loop to set it to.index
- the position to replace.java.util.Vector.setElementAt
public void removeElementAt(int index)
index
- the position to remove.java.util.Vector.removeElementAt
public void insertElementAt(java.lang.Object obj, int index) throws WrongElementType
obj
- The item or loopto insert.index
- the position to insert it in from of.java.util.Vector.insertElementAt
public void addElement(java.lang.Object obj) throws WrongElementType
obj
- The item or loop to add.java.util.Vector.addElement
public boolean removeElement(java.lang.Object obj)
obj
- The item or loop to remove.java.util.Vector.removeElement
public VectorCheckType searchByName(java.lang.String searchFor)
The search for names is case-insensitive.
searchByName
in class StarNode
searchFor
- - Look for this string as the tag name.public VectorCheckType searchByTagValue(java.lang.String tag, java.lang.String value)
Only searches starting at the node it was called from, and its children. Recurses downward, but does not recurse upward. This function is only capable of returning one answer, so it cannot be called at the same levels where searchByTag() can be called (see above).
The search for tag names is case-insensitive.
The search for values, however is case-sensitive.
searchByTagValue
in class StarNode
tag
- - Look for this tag...value
- - Where it has this value.public VectorCheckType searchForType(java.lang.Class type, short delim)
The second parameter is optional and is only useful when you are searching for DataValueNodes. It determines the kind of DataValueNode you are searching for, by delimiter type. For example, you could search for only those DataValueNodes that are semicolon-delimited by passing DataValueNode::SEMICOLON as the second argument. Or you could look for just framecodes by passing DataValueNode::FRAMECODE as the second parameter. Passing a negative number says you want all the DataValueNodes, regardless of their delimiter type.
If the search is for some StarNode other than DataValueNode, then it is irrelevant what the second parameter of this function is, as it will never be used - You can just leave it off and accept the default.
searchForType
in class StarNode
type
- - type to search fordelim
- - DataValueNode::ValType to look for. Set to
DataValueNode.DONT_CARE if it doesn't matter.public void Unparse(int indent)
Unparse
in class StarNode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |