Lines Matching refs:elements
29 * An immutable collection. Does not permit null elements.
32 * #asList()} method, which returns a list view of the collection's elements.
51 * Returns an unmodifiable iterator across the elements in this collection.
221 private final E[] elements;
223 ArrayImmutableCollection(E[] elements) {
224 this.elements = elements;
228 return elements.length;
236 return Iterators.forArray(elements);
245 final Object[] elements;
246 SerializedForm(Object[] elements) {
247 this.elements = elements;
250 return elements.length == 0
252 : new ArrayImmutableCollection<Object>(Platform.clone(elements));
278 * Adds each element of {@code elements} to the {@code ImmutableCollection}
284 * @param elements the elements to add
286 * @throws NullPointerException if {@code elements} is null or contains a
289 public Builder<E> add(E... elements) {
290 checkNotNull(elements); // for GWT
291 for (E element : elements) {
298 * Adds each element of {@code elements} to the {@code ImmutableCollection}
304 * @param elements the elements to add
306 * @throws NullPointerException if {@code elements} is null or contains a
309 public Builder<E> addAll(Iterable<? extends E> elements) {
310 checkNotNull(elements); // for GWT
311 for (E element : elements) {
318 * Adds each element of {@code elements} to the {@code ImmutableCollection}
324 * @param elements the elements to add
326 * @throws NullPointerException if {@code elements} is null or contains a
329 public Builder<E> addAll(Iterator<? extends E> elements) {
330 checkNotNull(elements); // for GWT
331 while (elements.hasNext()) {
332 add(elements.next());
339 * type, containing the elements provided to this builder.