org.vizzini.util
Class AbstractCollection

java.lang.Object
  extended by org.vizzini.util.AbstractCollection
All Implemented Interfaces:
Serializable, Iterable, Collection, ICollection
Direct Known Subclasses:
AbstractList, AbstractMap, TokenArrayCollection

public abstract class AbstractCollection
extends Object
implements ICollection

Provides base functionality for collections in the game framework.

Since:
v0.1
Version:
v0.1
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Constructor Summary
AbstractCollection()
           
 
Method Summary
 boolean addAll(Collection objects)
          Adds all of the objects in the given collection to this collection.
 boolean containsAll(Collection objects)
          Returns true if this collection contains all of the objects in the given collection.
protected abstract  Class getType()
          Return the type this collection holds.
 boolean removeAll(Collection objects)
          Removes all this collection's objects that are also contained in the given collection.
 boolean retainAll(Collection objects)
          Retains only the objects in this collection that are contained in the given collection.
 Object[] toArray()
          Returns an array containing all of the objects in this collection.
 Object[] toArray(Object[] array)
          Returns an array containing all of the objects in this collection; the runtime type of the returned array is that of the given array.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
add, clear, contains, equals, hashCode, isEmpty, iterator, remove, size
 

Constructor Detail

AbstractCollection

public AbstractCollection()
Method Detail

addAll

public boolean addAll(Collection objects)
Adds all of the objects in the given collection to this collection.

Specified by:
addAll in interface Collection
Parameters:
objects - The collection of objects to add.
Since:
v0.1

containsAll

public boolean containsAll(Collection objects)
Returns true if this collection contains all of the objects in the given collection.

Specified by:
containsAll in interface Collection
Since:
v0.1

removeAll

public boolean removeAll(Collection objects)
Removes all this collection's objects that are also contained in the given collection.

Specified by:
removeAll in interface Collection
Since:
v0.1

retainAll

public boolean retainAll(Collection objects)
Retains only the objects in this collection that are contained in the given collection.

Specified by:
retainAll in interface Collection
Since:
v0.1

toArray

public Object[] toArray()
Returns an array containing all of the objects in this collection. The array type corresponds to the return value of getType().

Specified by:
toArray in interface Collection
Since:
v0.1

toArray

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

Specified by:
toArray in interface Collection
Since:
v0.1

toString

public String toString()
Return a string representation of this object.

Specified by:
toString in interface ICollection
Overrides:
toString in class Object
Since:
v0.1

getType

protected abstract Class getType()
Return the type this collection holds.

Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02