Home | History | Annotate | Download | only in util

Lines Matching refs:Collection

22  * {@code Collection} is the root of the collection hierarchy. It defines operations on
24 * of {@code Collection}s.
26 * All direct or indirect implementations of {@code Collection} should implement at
28 * collection and one with a parameter of type {@code Collection}. This second
29 * constructor can be used to create a collection of different type as the
30 * initial collection but with the same elements. Implementations of {@code Collection}
34 * Methods that change the content of a collection throw an
35 * {@code UnsupportedOperationException} if the underlying collection does not
37 * in cases where the requested operation would not change the collection. In
42 * {@code UnsupportedOperationException} if the underlying collection doesn't
45 public interface Collection<E> extends Iterable<E> {
49 * {@code Collection} (optional).
52 * is contained in the collection.
54 * If the collection was modified it returns {@code true}, {@code false} if
57 * An implementation of {@code Collection} may narrow the set of accepted
62 * If a collection does not yet contain an object that is to be added and
66 * of the collection after this method finishes.
70 * @return {@code true} if this {@code Collection} is
74 * if adding to this {@code Collection} is not supported.
77 * collection.
79 * if the object cannot be added to this {@code Collection}.
81 * if null elements cannot be added to the {@code Collection}.
86 * Attempts to add all of the objects contained in {@code Collection}
87 * to the contents of this {@code Collection} (optional). If the passed {@code Collection}
88 * is changed during the process of adding elements to this {@code Collection}, the
91 * @param collection
92 * the {@code Collection} of objects.
93 * @return {@code true} if this {@code Collection} is modified, {@code false}
96 * if adding to this {@code Collection} is not supported.
99 * {@code Collection}.
101 * if an object cannot be added to this {@code Collection}.
103 * if {@code collection} is {@code null}, or if it
104 * contains {@code null} elements and this {@code Collection} does
107 public boolean addAll(Collection<? extends E> collection);
110 * Removes all elements from this {@code Collection}, leaving it empty (optional).
113 * if removing from this {@code Collection} is not supported.
121 * Tests whether this {@code Collection} contains the specified object. Returns
123 * {@code Collection} meets following requirement:
128 * @return {@code true} if object is an element of this {@code Collection},
135 * {@code Collection} doesn't support {@code null} elements.
140 * Tests whether this {@code Collection} contains all objects contained in the
141 * specified {@code Collection}. If an element {@code elem} is contained several
142 * times in the specified {@code Collection}, the method returns {@code true} even
143 * if {@code elem} is contained only once in this {@code Collection}.
145 * @param collection
146 * the collection of objects.
147 * @return {@code true} if all objects in the specified {@code Collection} are
148 * elements of this {@code Collection}, {@code false} otherwise.
150 * if one or more elements of {@code collection} isn't of the
153 * if {@code collection} contains at least one {@code null}
154 * element and this {@code Collection} doesn't support {@code null}
157 * if {@code collection} is {@code null}.
159 public boolean containsAll(Collection<?> collection);
184 * Returns if this {@code Collection} contains no elements.
186 * @return {@code true} if this {@code Collection} has no elements, {@code false}
195 * objects contained by this {@code Collection}. The order in which the elements are
197 * {@code Collection} has a defined order the elements are returned in that order.
199 * @return an iterator for accessing the {@code Collection} contents.
204 * Removes one instance of the specified object from this {@code Collection} if one
210 * @return {@code true} if this {@code Collection} is modified, {@code false}
213 * if removing from this {@code Collection} is not supported.
217 * if {@code object} is {@code null} and this {@code Collection}
223 * Removes all occurrences in this {@code Collection} of each object in the
224 * specified {@code Collection} (optional). After this method returns none of the
225 * elements in the passed {@code Collection} can be found in this {@code Collection}
228 * @param collection
229 * the collection of objects to remove.
230 * @return {@code true} if this {@code Collection} is modified, {@code false}
234 * if removing from this {@code Collection} is not supported.
236 * if one or more elements of {@code collection}
239 * if {@code collection} contains at least one
240 * {@code null} element and this {@code Collection} doesn't support
243 * if {@code collection} is {@code null}.
245 public boolean removeAll(Collection<?> collection);
248 * Removes all objects from this {@code Collection} that are not also found in the
249 * {@code Collection} passed (optional). After this method returns this {@code Collection}
250 * will only contain elements that also can be found in the {@code Collection}
253 * @param collection
254 * the collection of objects to retain.
255 * @return {@code true} if this {@code Collection} is modified, {@code false}
258 * if removing from this {@code Collection} is not supported.
260 * if one or more elements of {@code collection}
263 * if {@code collection} contains at least one
264 * {@code null} element and this {@code Collection} doesn't support
267 * if {@code collection} is {@code null}.
269 public boolean retainAll(Collection<?> collection);
272 * Returns a count of how many objects this {@code Collection} contains.
274 * @return how many objects this {@code Collection} contains, or Integer.MAX_VALUE
276 * {@code Collection}.
281 * Returns a new array containing all elements contained in this {@code Collection}.
286 * The array returned does not reflect any changes of the {@code Collection}. A new
290 * @return an array of the elements from this {@code Collection}.
295 * Returns an array containing all elements contained in this {@code Collection}. If
298 * specified array is used and is larger than this {@code Collection}, the array
299 * element following the {@code Collection} elements is set to null.
309 * @return an array of the elements from this {@code Collection}.
312 * if the type of an element in this {@code Collection} cannot be