| xtc.parser.Element xtc.parser.Sequence
Sequence | public class Sequence extends Element (Code) | | A sequence of grammar elements.
A sequence may have an optional name. However, this name is
not considered when comparing sequences for equality.
author: Robert Grimm version: $Revision: 1.30 $ |
Method Summary | |
public Sequence | add(Element e) Add the specified element to this sequence.
Parameters: e - The element to add. | public Sequence | addAll(List<Element> l) Add all elements in the specified list to this sequence.
Parameters: l - The list of elements. | public Sequence | clear() Remove all elements from this sequence. | public static Sequence | ensure(Element e) Ensure that the specified element is a sequence. | public boolean | equals(Object o) | public Element | get(int idx) Get the element at the specified index.
Parameters: idx - The index. | public boolean | hasTrailingChoice() Determine whether this sequence's last element is an ordered
choice. | public int | hashCode() | public boolean | isEmpty() Determine whether this sequence is empty. | public int | size() Get the size of this sequence. | public Sequence | subSequence(int start) Create a new subsequence from the specified start index. | public Sequence | subSequence(int start, int end) Create a new subsequence for the specified indices.
Parameters: start - The inclusive start index. Parameters: end - The exclusive end index. | public Tag | tag() | public void | write(Appendable out) |
Sequence | public Sequence()(Code) | | Create a new, empty sequence.
|
Sequence | public Sequence(int capacity)(Code) | | Create a new, empty sequence with the specified capacity.
Parameters: capacity - The capacity. |
Sequence | public Sequence(List<Element> elements)(Code) | | Create a new sequence.
Parameters: elements - The list of elements. |
Sequence | public Sequence(SequenceName name, List<Element> elements)(Code) | | Create a new sequence.
Parameters: name - The name. Parameters: elements - The list of elements. |
Sequence | public Sequence(Element element)(Code) | | Create a new sequence with the specified element. If the element
is another sequence, the new sequence has the same elements but
is a copy. Otherwise, the new sequence has the specified element
as its only element. In either case, the new sequence has the
element's location.
Parameters: element - The element. |
add | public Sequence add(Element e)(Code) | | Add the specified element to this sequence.
Parameters: e - The element to add. This sequence. |
addAll | public Sequence addAll(List<Element> l)(Code) | | Add all elements in the specified list to this sequence.
Parameters: l - The list of elements. This sequence. |
clear | public Sequence clear()(Code) | | Remove all elements from this sequence.
This sequence. |
ensure | public static Sequence ensure(Element e)(Code) | | Ensure that the specified element is a sequence. If the specified
element is not a sequence, a new sequence with the specified
element as its only element is returned; the newly created
sequence has the element's location.
Parameters: e - The element. The element in/as a sequence. |
get | public Element get(int idx)(Code) | | Get the element at the specified index.
Parameters: idx - The index. The element at that position. throws: IndexOutOfBoundsException - Signals that the index is out of range. |
hasTrailingChoice | public boolean hasTrailingChoice()(Code) | | Determine whether this sequence's last element is an ordered
choice.
true if the last element is a choice. |
hashCode | public int hashCode()(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | Determine whether this sequence is empty.
true if this is an empty sequence. |
size | public int size()(Code) | | Get the size of this sequence.
The size. |
subSequence | public Sequence subSequence(int start)(Code) | | Create a new subsequence from the specified start index. The new
subsequence ends with the last element of this sequence.
Parameters: start - The inclusive start index. The subsequence. throws: IndexOutOfBoundsException - Signals that the index is out of range. |
subSequence | public Sequence subSequence(int start, int end)(Code) | | Create a new subsequence for the specified indices.
Parameters: start - The inclusive start index. Parameters: end - The exclusive end index. The subsequence. throws: IndexOutOfBoundsException - Signals that the index is out of range. |
Methods inherited from xtc.parser.Element | abstract public Tag tag()(Code)(Java Doc)
|
|
|