Lines Matching defs:elements

28  * An immutable collection. Does not permit null elements.
31 * #asList()} method, which returns a list view of the collection's elements.
50 * Returns an unmodifiable iterator across the elements in this collection.
219 private final E[] elements;
221 ArrayImmutableCollection(E[] elements) {
222 this.elements = elements;
227 return elements.length;
235 return Iterators.forArray(elements);
239 return elements.length == 1 ? new SingletonImmutableList<E>(elements[0])
240 : new RegularImmutableList<E>(elements);
253 final Object[] elements;
254 SerializedForm(Object[] elements) {
255 this.elements = elements;
258 return elements.length == 0
260 : new ArrayImmutableCollection<Object>(Platform.clone(elements));
292 * Adds each element of {@code elements} to the {@code ImmutableCollection}
298 * @param elements the elements to add
300 * @throws NullPointerException if {@code elements} is null or contains a
303 public Builder<E> add(E... elements) {
304 for (E element : elements) {
311 * Adds each element of {@code elements} to the {@code ImmutableCollection}
317 * @param elements the elements to add
319 * @throws NullPointerException if {@code elements} is null or contains a
322 public Builder<E> addAll(Iterable<? extends E> elements) {
323 for (E element : elements) {
330 * Adds each element of {@code elements} to the {@code ImmutableCollection}
336 * @param elements the elements to add
338 * @throws NullPointerException if {@code elements} is null or contains a
341 public Builder<E> addAll(Iterator<? extends E> elements) {
342 while (elements.hasNext()) {
343 add(elements.next());
350 * type, containing the elements provided to this builder.