| org.griphyn.vdl.classes.VDL org.griphyn.vdl.classes.Value org.griphyn.vdl.classes.List
List | public class List extends Value implements Cloneable,Serializable(Code) | | This class implements the list argument type used for parameters passed
to transformations from derivations.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: Value See Also: Scalar |
Constructor Summary | |
public | List() Default ctor. | public | List(Scalar firstChild) Convenience ctor: Initializes the list, and stores the given
Scalar as first child into the list. |
Method Summary | |
public void | addScalar(Scalar vScalar) Accessor: Appends as Scalar value to the list. | public void | addScalar(int index, Scalar vScalar) Accessor: Insert a Scalar at a specific position. | public Object | clone() Creates and returns a copy of this object. | public boolean | containsLFN(String filename, int linkage) Determines if the list contains an LFN of the specified linkage.
The logic uses short-circuit evaluation, thus finding things is
faster than not finding things. | public Enumeration | enumerateScalar() Accessor: constructs the iterator for the List items. | public java.util.List | getAllLFN(int linkage) Determines all LFN instances of a given scalar that match the
specified linkage. | public int | getContainerType() Accessor: Obtains the value type of this class. | public java.util.List | getLFNList(int linkage) Determines all LFN instances of a given scalar that match the
specified linkage. | public Scalar | getScalar(int index) Accessor: Obtains the value of a specific item in the list.
Parameters: index - is the position of which to obtain the value of. | public Scalar[] | getScalar() Accessor: Gets an array of all Scalar s in the list. | public int | getScalarCount() | public java.util.List | getScalarList() Accessor: Gets an array of all Scalar s in the list.
This list is read-only. | public String | getSymbolicType() This method determines which container is being used in the abstract
base class in order to kludgy statements when printing debug info. | public Iterator | iterateScalar() Accessor: constructs the iterator for the List items. | public ListIterator | listIterateScalar() Accessor: constructs the iterator for the List items. | public ListIterator | listIterateScalar(int start) Accessor: constructs the iterator for the List items.
Parameters: start - is the starting position for the sub-iteration. | public void | removeAllScalar() Accessor: Removes all elements in the List . | public Scalar | removeScalar(int index) Accessor: Removes a single element from the List . | public void | setScalar(int index, Scalar vScalar) Accessor: Overwrite an element at a given position.
Parameters: index - is the position to use. | public void | setScalar(Scalar[] scalarArray) Accessor: Replaces all elements with a new list of
Scalar s. | public void | setScalar(Collection scalars) Accessor: Replaces all elements with a new list of
Scalar s. | public void | toString(Writer stream) Dumps the list and all its contents into a string. | public void | toXML(Writer stream, String indent, String namespace) Dump the state of the current element as XML output. |
List | public List()(Code) | | Default ctor.
|
List | public List(Scalar firstChild)(Code) | | Convenience ctor: Initializes the list, and stores the given
Scalar as first child into the list.
Parameters: firstChild - is the first element in the list |
addScalar | public void addScalar(int index, Scalar vScalar) throws IndexOutOfBoundsException(Code) | | Accessor: Insert a Scalar at a specific position.
Parameters: index - is the position to insert the item into Parameters: vScalar - is the Scalar to append to the list. throws: IndexOutOfBoundsException - if the value cannot be added. See Also: Scalar |
clone | public Object clone()(Code) | | Creates and returns a copy of this object.
a new instance. |
containsLFN | public boolean containsLFN(String filename, int linkage)(Code) | | Determines if the list contains an LFN of the specified linkage.
The logic uses short-circuit evaluation, thus finding things is
faster than not finding things. Searching a list is a potentially
expensive method.
Parameters: filename - is the name of the LFN Parameters: linkage - is the linkage to check for, -1 for any linkage type. true if the LFN is contained in the scalar, false otherwise. See Also: org.griphyn.vdl.classes.LFN See Also: See Also: Scalar.containsLFN(Stringint) |
enumerateScalar | public Enumeration enumerateScalar()(Code) | | Accessor: constructs the iterator for the List items.
an enumeration to walk the list with. |
getAllLFN | public java.util.List getAllLFN(int linkage)(Code) | | Determines all LFN instances of a given scalar that match the
specified linkage. This is a higher-level method employing the
given API.
Parameters: linkage - is the linkage to check for, -1 for all filenames. a set of logical filename instances that match the linkageand were part of the scalar. The result may be an empty set, if nosuch result were to be found. See Also: Scalar.getAllLFN(int) See Also: LFN See Also: |
getContainerType | public int getContainerType()(Code) | | Accessor: Obtains the value type of this class. By using the abstract
method in the parent class, List objects can be
distinguished from Scalar objects without using the
instanceof operator.
the fixed value of being a scalar. See Also: Value.LIST See Also: |
getLFNList | public java.util.List getLFNList(int linkage)(Code) | | Determines all LFN instances of a given scalar that match the
specified linkage. This is a higher-level method employing the
given API. Note that also linkage of NONE will not be found in
wildcard search mode.
Parameters: linkage - is the linkage to check for, -1 for all filenames. a set of all logical filenames that match the linkage andwere part of the scalar. The result may be an empty set, if no suchresult were to be found. For a linkage of -1, complete LFNs will bereturned, for any other linkage, just the filename will bereturned. See Also: Scalar.getLFNList(int) See Also: See Also: Derivation.getLFNList(int) See Also: See Also: LFN See Also: |
getScalar | public Scalar getScalar(int index) throws IndexOutOfBoundsException(Code) | | Accessor: Obtains the value of a specific item in the list.
Parameters: index - is the position of which to obtain the value of. The Scalar at the specified position. throws: IndexOutOfBoundsException - if the index points to an elementthat is beyond the list boundaries. |
getScalar | public Scalar[] getScalar()(Code) | | Accessor: Gets an array of all Scalar s in the list.
an array of Scalar s. See Also: Scalar |
getScalarCount | public int getScalarCount()(Code) | | Accessor: Obtains the element count of the internal list
number of elements in the internal list |
getScalarList | public java.util.List getScalarList()(Code) | | Accessor: Gets an array of all Scalar s in the list.
This list is read-only.
an array of Scalar s. See Also: Scalar |
getSymbolicType | public String getSymbolicType()(Code) | | This method determines which container is being used in the abstract
base class in order to kludgy statements when printing debug info.
the symblic identifier for the type of the Value. |
iterateScalar | public Iterator iterateScalar()(Code) | | Accessor: constructs the iterator for the List items.
an enumeration to walk the list with. |
listIterateScalar | public ListIterator listIterateScalar()(Code) | | Accessor: constructs the iterator for the List items.
an enumeration to walk the list with. |
listIterateScalar | public ListIterator listIterateScalar(int start)(Code) | | Accessor: constructs the iterator for the List items.
Parameters: start - is the starting position for the sub-iteration. an enumeration to walk the list with. |
removeAllScalar | public void removeAllScalar()(Code) | | Accessor: Removes all elements in the List .
|
removeScalar | public Scalar removeScalar(int index)(Code) | | Accessor: Removes a single element from the List . Each
component in this vector with an index greater or equal to the
specified index is shifted downward to have an index one smaller
than the value it had previously. The size of this vector is
decreased by 1.
Parameters: index - is the position at which an element is to be removed. the Scalar that was removed. throws: ArrayIndexOutOfBoundsException - if the index was invalid. |
setScalar | public void setScalar(int index, Scalar vScalar) throws IndexOutOfBoundsException(Code) | | Accessor: Overwrite an element at a given position.
Parameters: index - is the position to use. It must be within the list. Parameters: vScalar - is the new value to replace the element with. throws: IndexOutOfBoundsException - if the position is outside the list. |
setScalar | public void setScalar(Scalar[] scalarArray)(Code) | | Accessor: Replaces all elements with a new list of
Scalar s.
Parameters: scalarArray - is the list to replace the original list with. |
setScalar | public void setScalar(Collection scalars)(Code) | | Accessor: Replaces all elements with a new list of
Scalar s.
Parameters: scalars - is the list to replace the original list with. |
toString | public void toString(Writer stream) throws IOException(Code) | | Dumps the list and all its contents into a string. The list will
be terminated by brackets, elements separated by komma, space.
Elements itself will be dumped by recursive calls to the element
specific method of the same name.
Parameters: stream - is a stream opened and ready for writing. This can alsobe a string stream for efficient output. exception: IOException - if something fishy happens to the stream. |
toXML | public void toXML(Writer stream, String indent, String namespace) throws IOException(Code) | | Dump the state of the current element as XML output. This function
traverses all sibling classes as necessary, and converts the data
into pretty-printed XML output. The stream interface should be able
to handle large output efficiently, if you use a buffered writer.
Parameters: stream - is a stream opened and ready for writing. This can alsobe a string stream for efficient output. Parameters: indent - is a String of spaces used for prettyprinting. The initial amount of spaces should be an empty string.The parameter is used internally for the recursive traversal. Parameters: namespace - is the XML schema namespace prefix. If neitherempty nor null, each element will be prefixed with this prefix,and the root element will map the XML namespace. exception: IOException - if something fishy happens to the stream. |
|
|