|
||||||||||
| 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.Value
org.griphyn.vdl.classes.Scalar
public class Scalar
This class implements one of the argument types for parameters passed to transformations from derivations.
Value,
List,
Serialized Form| Field Summary | |
|---|---|
private ArrayList |
m_leafList
Any value passed down is an arbitrary mix of the three potential Leaf types. |
| Fields inherited from class org.griphyn.vdl.classes.Value |
|---|
LIST, SCALAR |
| Constructor Summary | |
|---|---|
Scalar()
Default ctor. |
|
Scalar(Leaf firstChild)
Convenience ctor: Initializes the object with the first child to be put into the list of values. |
|
| Method Summary | |
|---|---|
void |
addLeaf(int index,
Leaf vLeaf)
Accessor: Inserts a Leaf value into a specific position
of the list of gathered values. |
void |
addLeaf(Leaf vLeaf)
Accessor: Adds a Leaf value to the list of values gathered
as the content of a Scalar. |
Object |
clone()
Creates and returns a copy of this object. |
boolean |
containsLFN(String filename,
int linkage)
Determines if the scalar contains an LFN of the specified linkage. |
Enumeration |
enumerateLeaf()
Deprecated. Use the new Collection based interfaces |
List |
getAllLFN(int linkage)
Determines all LFN instances of a given scalar that match the specified linkage. |
int |
getContainerType()
Accessor: Obtains the value type of this class. |
Leaf[] |
getLeaf()
Deprecated. Use the new Collection based interfaces |
Leaf |
getLeaf(int index)
Accessor: Obtains the Leaf at a certain position in the
list of leaf values. |
int |
getLeafCount()
Accessor: Obtains the size of the internal list of Leafs. |
List |
getLeafList()
Accessor: Gets an array of all values that constitute the current content. |
List |
getLFNList(int linkage)
Determines all LFN instances of a given scalar that match the specified linkage. |
String |
getSymbolicType()
This method determines which container is being used in the abstract base class in order to kludgy statements when printing debug info. |
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 the content of the Scalar. |
Leaf |
removeLeaf(int index)
Accessor: Remove a single item from the list of nodes. |
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 LFN or Text value
at a certain position in the content-constituting list. |
void |
setLeaf(Leaf[] leafArray)
Deprecated. Use the new Collection based interfaces |
String |
toString()
Converts the object state into textual format for human consumption. |
void |
toString(Writer stream)
Converts the object state 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.classes.Value |
|---|
getName, isInRange, setName |
| Methods inherited from class org.griphyn.vdl.Chimera |
|---|
escape, quote, toXML, toXML, writeAttribute |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private ArrayList m_leafList
Leaf types.
Leaf,
Text,
LFN| Constructor Detail |
|---|
public Scalar()
public Scalar(Leaf firstChild)
firstChild - is either a LFN or Text
object.Leaf,
LFN,
Text| Method Detail |
|---|
public Object clone()
clone in class Valuepublic int getContainerType()
Scalar objects can be
distinguished from List objects without using the
instanceof operator.
getContainerType in class ValueValue.SCALARpublic String getSymbolicType()
getSymbolicType in class Value
public void addLeaf(Leaf vLeaf)
throws IndexOutOfBoundsException
Leaf value to the list of values gathered
as the content of a Scalar.
vLeaf - is the value to append to the list. Note that only leaf
values of LFN or Text are allowed.
IndexOutOfBoundsException - if the value cannot be added.Leaf,
Text,
LFN
public void addLeaf(int index,
Leaf vLeaf)
throws IndexOutOfBoundsException
Leaf value into a specific position
of the list of gathered values.
index - is the position to insert the item intovLeaf - is the value to append to the list. Note that only leaf
values of LFN or Text are allowed.
IndexOutOfBoundsException - if the value cannot be added.Text,
LFNpublic Enumeration enumerateLeaf()
Scalar element.
public List getAllLFN(int linkage)
getAllLFN in class Valuelinkage - is the linkage to check for, -1 for all filenames.
LFNpublic List getLFNList(int linkage)
getLFNList in class Valuelinkage - is the linkage to check for, -1 for all filenames.
Derivation.getLFNList( int ),
LFN
public boolean containsLFN(String filename,
int linkage)
containsLFN in class Valuefilename - is the name of the LFNlinkage - is the linkage to check for, -1 for any linkage type.
LFN
public Leaf getLeaf(int index)
throws IndexOutOfBoundsException
Leaf at a certain position in the
list of leaf values.
index - is the position in the list to obtain a value from
LFN or Text at the position.
IndexOutOfBoundsException - if the index points to an elment
in the list that does not contain any elments.LFN,
Textpublic Leaf[] getLeaf()
Text or
LFN values.LFN,
Textpublic int getLeafCount()
Leafs.
public List getLeafList()
Text or
LFN values.LFN,
Textpublic Iterator iterateLeaf()
Scalar element.
public ListIterator listIterateLeaf()
Scalar element.
public ListIterator listIterateLeaf(int start)
Scalar element.
start - is the start index
public void removeAllLeaf()
Scalar.
public Leaf removeLeaf(int index)
index - is the position at which an element is to be removed.
LFN or a Text.LFN,
Text
public void setLeaf(int index,
Leaf vLeaf)
throws IndexOutOfBoundsException
LFN or Text value
at a certain position in the content-constituting list.
index - position to overwrite an elment in.vLeaf - is either a LFN or Text object.
IndexOutOfBoundsException - if the position pointed to is invalid.LFN,
Textpublic void setLeaf(Leaf[] leafArray)
Scalar value.
leafArray - is the external list of Text or
LFN objects used to overwrite things.Text,
LFNpublic void setLeaf(Collection leaves)
Scalar value.
leaves - is the external list of Text or
LFN objects used to overwrite things.Text,
LFNpublic String toString()
toString in class Chimera
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.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 | |||||||||