Interface and Class Details

Interface Collection

public abstract interface Collection

The Collection interface is the base interface for all Collection interfaces and the basis of all Collection classes in the Collection framework. Collection is simply a set of objects that can be treated as individual items or as a group. The Collection interface specifies methods for dealing with individual objects, such as add(), and for dealing with a whole Collection at once, such as removeAll().

boolean     add(Object o)
boolean     addAll(Collection c)
void        clear()
boolean     contains(Object o)
boolean     containsAll(Collection c)
boolean     equals(Object o)
int         hashCode()
boolean     isEmpty()
Iterator    iterator()
boolean     remove(Object o)
boolean     removeAll(Collection ...

Get PURE Java™ 2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.