weiss.util
Interface Collection

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
List, Set, SortedSet
All Known Implementing Classes:
AbstractCollection

public interface Collection
extends java.io.Serializable

Collection interface; the root of all 1.2 collections.


Method Summary
 boolean add(java.lang.Object x)
          Adds an item to this collection.
 void clear()
          Change the size of this collection to zero.
 boolean contains(java.lang.Object x)
          Tests if some item is in this collection.
 boolean isEmpty()
          Tests if this collection is empty.
 Iterator iterator()
          Obtains an Iterator object used to traverse the collection.
 boolean remove(java.lang.Object x)
          Removes an item from this collection.
 int size()
          Returns the number of items in this collection.
 java.lang.Object[] toArray()
          Obtains a primitive array view of the collection.
 

Method Detail

size

public int size()
Returns the number of items in this collection.
Returns:
the number of items in this collection.

isEmpty

public boolean isEmpty()
Tests if this collection is empty.
Returns:
true if the size of this collection is zero.

contains

public boolean contains(java.lang.Object x)
Tests if some item is in this collection.
Parameters:
x - any object.
Returns:
true if this collection contains an item equal to x.

add

public boolean add(java.lang.Object x)
Adds an item to this collection.
Parameters:
x - any object.
Returns:
true if this item was added to the collection.

remove

public boolean remove(java.lang.Object x)
Removes an item from this collection.
Parameters:
x - any object.
Returns:
true if this item was removed from the collection.

clear

public void clear()
Change the size of this collection to zero.

iterator

public Iterator iterator()
Obtains an Iterator object used to traverse the collection.

toArray

public java.lang.Object[] toArray()
Obtains a primitive array view of the collection.