|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.vdl.Chimera
org.griphyn.vdl.classes.VDL
org.griphyn.vdl.classes.Argument
public class Argument
A class to encapsulate a command line argument line. The command line
is separated into a list of distinct fragments. Each fragment can only
be of type Use or Text.
Leaf,
Text,
Use,
Serialized Form| Field Summary | |
|---|---|
private static String |
c_error_message
Throws this message, if neither <text> nor <use> elements are tried to be added. |
private ArrayList |
m_leafList
The command line consists of an ordered list of Leaf
pieces, which in their sum create the commandline. |
private String |
m_name
Each Argument is a fragment of the complete command
line. |
| Constructor Summary | |
|---|---|
Argument()
Array ctor. |
|
Argument(String name)
Standard ctor: Constructs a named Argument group. |
|
Argument(String name,
Leaf firstChild)
Convenience ctor: Constructs a name argument group, and enters the first (and possibly only) fragment into the group. |
|
| Method Summary | |
|---|---|
void |
addLeaf(int index,
Leaf vLeaf)
Accessor: Inserts a Leaf value into a specific position
of this commandline group. |
void |
addLeaf(Leaf vLeaf)
Accessor: Appends a commandline fragment to the current group. |
Enumeration |
enumerateLeaf()
Deprecated. Use the new Collection based interfaces |
Leaf[] |
getLeaf()
Deprecated. Use the new Collection based interfaces |
Leaf |
getLeaf(int index)
Accessor: Obtains the Leaf at a certain position in the
commandline argument group. |
int |
getLeafCount()
Accessor: Obtains the size of the commandline group. |
List |
getLeafList()
Accessor: Gets an array of all values that constitute the current content. |
String |
getName()
Accessor: Obtains the current name of this commandline group. |
Iterator |
iterateLeaf()
Accessor: Enumerates the internal values that constitute the content of the Scalar element. |
ListIterator |
listIterateLeaf()
Accessor: Enumerates the internal values that constitute the content of the Scalar element. |
ListIterator |
listIterateLeaf(int start)
Accessor: Enumerates the internal values that constitute the content of the Scalar element. |
void |
removeAllLeaf()
Accessor: Removes all values from this commandline group. |
Leaf |
removeLeaf(int index)
Accessor: Removes a specific fragment from this commandline group. |
void |
setLeaf(Collection leaves)
Accessor: Overwrites internal list with an external list representing a Scalar value. |
void |
setLeaf(int index,
Leaf vLeaf)
Accessor: Overwrites a Use or Text value
fragment at a certain position in this command line group. |
void |
setLeaf(Leaf[] leafArray)
Deprecated. Use the new Collection based interfaces |
void |
setName(String name)
Accessor: Replaces or sets the current identifier for this commandline group. |
void |
toString(Writer stream)
Converts the commandline group into textual format for human consumption. |
void |
toXML(Writer stream,
String indent,
String namespace)
Dump the state of the current element as XML output. |
| Methods inherited from class org.griphyn.vdl.Chimera |
|---|
escape, quote, toString, toXML, toXML, writeAttribute |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final String c_error_message
private ArrayList m_leafList
Leaf
pieces, which in their sum create the commandline. Any value passed
down is an arbitrary mix of the three potential Leaf
types. Each element only allows for Text and
Use children in arbitrary number and order.
Leaf,
Text,
Useprivate String m_name
Argument is a fragment of the complete command
line. Each such group (of fragments) can be given a name. Special
names of the stdio handles refer to these handles.
| Constructor Detail |
|---|
public Argument()
public Argument(String name)
Argument group.
name - is the identifier for the argument group.
public Argument(String name,
Leaf firstChild)
name - is the unique identifier for the argument group.firstChild - is the element to place into the argument group. Only
Leafs of type Use or Text
are permissable.Leaf,
Use,
Text| Method Detail |
|---|
public void addLeaf(Leaf vLeaf)
throws IndexOutOfBoundsException,
IllegalArgumentException
vLeaf - is the fragment to add. Note that only leaf values of
Use or Text are allowed.
IndexOutOfBoundsException - if the value cannot be added.
IllegalArgumentException - if the value type is neither
Use nor Text.Leaf,
Text,
Use
public void addLeaf(int index,
Leaf vLeaf)
throws IndexOutOfBoundsException,
IllegalArgumentException
Leaf value into a specific position
of this commandline group.
index - is the position to insert the item intovLeaf - is the value to append to the list. Note that only leaf
values of Use or Text are allowed.
IndexOutOfBoundsException - if the value cannot be added.
IllegalArgumentException - if the value type is neither
Use nor Text.Text,
Usepublic Enumeration enumerateLeaf()
public Leaf getLeaf(int index)
throws IndexOutOfBoundsException
Leaf at a certain position in the
commandline argument group.
index - is the position in the list to obtain a value from
Use or Text at the position.
IndexOutOfBoundsException - if the index points to an element
in the list that does not contain any elments.Use,
Textpublic Leaf[] getLeaf()
Text or
Use values.Use,
Textpublic int getLeafCount()
public List getLeafList()
Text or
LFN values.LFN,
Textpublic String getName()
setName(java.lang.String)public Iterator iterateLeaf()
Scalar element.
public ListIterator listIterateLeaf()
Scalar element.
public ListIterator listIterateLeaf(int start)
Scalar element.
start - is the start index
public void removeAllLeaf()
public Leaf removeLeaf(int index)
index - is the position at which an element is to be removed.
Use or a Text.Use,
Text
public void setLeaf(int index,
Leaf vLeaf)
throws IndexOutOfBoundsException,
IllegalArgumentException
Use or Text value
fragment at a certain position in this command line group.
index - position to overwrite an elment in.vLeaf - is either a Use or Text object.
IndexOutOfBoundsException - if the position pointed to is invalid.
IllegalArgumentException - if the added element is of the
incorrect Leaf type.Use,
Textpublic void setLeaf(Leaf[] leafArray)
leafArray - is the external list of Text or
Use objects used to overwrite things.Text,
Usepublic void setLeaf(Collection leaves)
Scalar value.
leaves - is the external list of Text or
LFN objects used to overwrite things.Text,
LFNpublic void setName(String name)
name - is the new identifier to use for this commandline group.getName()
public void toString(Writer stream)
throws IOException
toString in class Chimerastream - is a stream opened and ready for writing. This can also
be a string stream for efficient output.
IOException - if something fishy happens to the stream.
public void toXML(Writer stream,
String indent,
String namespace)
throws IOException
toXML in class Chimerastream - is a stream opened and ready for writing. This can also
be a string stream for efficient output.indent - is a String of spaces used for pretty
printing. The initial amount of spaces should be an empty string.
The parameter is used internally for the recursive traversal.
If a null value is specified, no indentation nor
linefeeds will be generated.namespace - is the XML schema namespace prefix. If neither
empty nor null, each element will be prefixed with this prefix,
and the root element will map the XML namespace.
IOException - if something fishy happens to the stream.BufferedWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||