All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.roguewave.tools.v2-0.Collection

public interface Collection
The Collection interface is implemented by the collection classes in the com.roguewave.tools.v2-0 package. The interface contains methods for the insertion, retrieval, and removal of elements.


Method Index

 o apply(UnaryFunction)
Applies the unary function to every element of the collection in turn.
 o clear()
Removes all elements from the collection
 o contains(Object)
Returns true if the collection contains an element equivalent to the given item.
 o elements()
Returns an Enumeration object, which can be used to visit Each element of the collection in turn.
 o find(Object)
Returns an element from the collection equivalent to the given item, or null if no such element is found.
 o insert(Object)
Inserts an item into the collection.
 o insertMany(Enumeration)
Inserts the elements enumerated by the Enumeration into the collection.
 o isEmpty()
Returns true if the collection is empty
 o occurrencesOf(Object)
Returns the number of elements in the collection equivalent to a given item.
 o reduce(BinaryFunction, Object)
Reduces the collection to a single value.
 o remove(Object)
Removes from the collection the first element that is equivalent to the given item.
 o removeAll(Object)
Removes from the collection all elements that are equivalent to the given item.
 o removeMany(Enumeration)
Removes from the collection the first elements equivalent to each item enumerated by the given Enumeration.
 o size()
Returns the number of entries in the collection

Methods

 o apply
 public abstract void apply(UnaryFunction f)
Applies the unary function to every element of the collection in turn. Note that the return value of the function is ignored.

 o clear
 public abstract void clear()
Removes all elements from the collection

 o contains
 public abstract boolean contains(Object item)
Returns true if the collection contains an element equivalent to the given item.

 o elements
 public abstract Enumeration elements()
Returns an Enumeration object, which can be used to visit Each element of the collection in turn.

 o find
 public abstract Object find(Object item)
Returns an element from the collection equivalent to the given item, or null if no such element is found.

 o insert
 public abstract Object insert(Object item)
Inserts an item into the collection.

Returns:
If the insertion is successful, the method returns the new element just inserted.
If the insertion fails because a like element already exists in a collection that does not admit duplicates, the existing element will be returned.
If the insertion fails for some other reason, null will be returned.
 o insertMany
 public abstract int insertMany(Enumeration e)
Inserts the elements enumerated by the Enumeration into the collection.

Returns:
The number of elements inserted into the collection.
 o isEmpty
 public abstract boolean isEmpty()
Returns true if the collection is empty

 o occurrencesOf
 public abstract int occurrencesOf(Object item)
Returns the number of elements in the collection equivalent to a given item.

 o reduce
 public abstract Object reduce(BinaryFunction f,
                               Object identity)
Reduces the collection to a single value. A result is initialized with identity. Then, for each element in the collection, a new result is computed by calling the binary function on the current result and the next element.

Returns:
The result as described above, or identity if the collection is empty.
 o remove
 public abstract Object remove(Object item)
Removes from the collection the first element that is equivalent to the given item.

 o removeMany
 public abstract int removeMany(Enumeration e)
Removes from the collection the first elements equivalent to each item enumerated by the given Enumeration.

Returns:
The number of items removed.
 o removeAll
 public abstract int removeAll(Object item)
Removes from the collection all elements that are equivalent to the given item.

 o size
 public abstract int size()
Returns the number of entries in the collection


All Packages  Class Hierarchy  This Package  Previous  Next  Index