Lines Matching defs: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
30 * initial collection but with the same elements. Implementations of {@code Collection}
45 public interface Collection<E> extends Iterable<E> {
49 * {@code Collection} (optional).
57 * An implementation of {@code Collection} may narrow the set of accepted
70 * @return {@code true} if this {@code Collection} is
74 * if adding to this {@code Collection} is not supported.
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
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}.
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}.
147 * @return {@code true} if all objects in the specified {@code Collection} are
148 * elements of this {@code Collection}, {@code false} otherwise.
154 * element and this {@code Collection} doesn't support {@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}
230 * @return {@code true} if this {@code Collection} is modified, {@code false}
234 * if removing from this {@code Collection} is not supported.
240 * {@code null} element and this {@code Collection} doesn't support
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}
255 * @return {@code true} if this {@code Collection} is modified, {@code false}
258 * if removing from this {@code Collection} is not supported.
264 * {@code null} element and this {@code Collection} doesn't support
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