Lines Matching refs:elements
33 /** A generic list of elements tracked in an alternative to be used in
38 * Once you start next()ing, do not try to add more elements. It will
48 * which bumps it to 1 meaning no more elements.
52 /** Track single elements w/o creating a list. Upon 2nd add, alloc list */
56 protected List elements;
94 List elements)
98 this.elements = elements;
102 * not consumed any of its elements. Elements themselves are untouched.
116 if ( elements!=null ) { // if in list, just add
117 elements.add(el);
120 if ( singleElement == null ) { // no elements yet, track w/o list
125 elements = new ArrayList(5);
126 elements.add(singleElement);
128 elements.add(el);
131 /** Return the next element in the stream. If out of elements, throw
132 * an exception unless size()==1. If size is 1, then return elements[0].
133 * Return a duplicate node/subtree if stream is out of elements and
139 // if out of elements and size is 1, dup
151 * if the stream is empty or we're out of elements and size>1.
159 if ( cursor>= n) { // out of elements?
163 // out of elements and size was not 1, so we can't dup
166 // we have elements
171 // must have more than one in list, pull from elements
172 Object o = toTree(elements.get(cursor));
193 (elements!=null && cursor < elements.size());
201 if ( elements!=null ) {
202 return elements.size();