chrriis.uihierarchy.compatibility
Interface Collection

All Known Subinterfaces:
List, Set
All Known Implementing Classes:
ArrayList, HashSet

public interface Collection

The Collection compatible version.

Version:
1.0 2004.01.11
Author:
Christopher Deckers (chrriis@brainlex.com)

Method Summary
 boolean add(Object o)
          Adds the specified element to this set if it is not already present (optional operation).
 boolean addAll(Collection c)
          Adds all of the elements in the specified collection to this set if they're not already present (optional operation).
 boolean contains(Object o)
          Returns true if this collection contains the specified element.
 boolean isEmpty()
          Returns true if this list contains no elements.
 boolean remove(Object o)
          Removes the first occurrence in this list of the specified element (optional operation).
 boolean removeAll(Collection c)
          Removes all this collection's elements that are also contained in the specified collection (optional operation).
 int size()
          Returns the number of elements in this list.
 Object[] toArray()
          Returns an array containing all of the elements in this collection.
 Object[] toArray(Object[] a)
          Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
 

Method Detail

contains

public boolean contains(Object o)
Returns true if this collection contains the specified element.

Parameters:
o - The object to look for.
Returns:
True if found.

remove

public boolean remove(Object o)
Removes the first occurrence in this list of the specified element (optional operation).

Parameters:
o - The element to remove.
Returns:
True if the element was present.

removeAll

public boolean removeAll(Collection c)
Removes all this collection's elements that are also contained in the specified collection (optional operation).

Parameters:
c - The collection of elements to remove.
Returns:
True if the collection was affected by this operation.

isEmpty

public boolean isEmpty()
Returns true if this list contains no elements.

Returns:
True if this list is empty.

size

public int size()
Returns the number of elements in this list.

Returns:
The size.

toArray

public Object[] toArray()
Returns an array containing all of the elements in this collection.

Returns:
The array.

toArray

public Object[] toArray(Object[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.

Parameters:
a - The array from which to get the type.
Returns:
The array.

add

public boolean add(Object o)
Adds the specified element to this set if it is not already present (optional operation).

Parameters:
o - The object to add.
Returns:
True if changed.

addAll

public boolean addAll(Collection c)
Adds all of the elements in the specified collection to this set if they're not already present (optional operation).

Parameters:
c - The collection.
Returns:
True if changed.