org.jrabbit.base.data.structures.base
Interface Container<T>

Type Parameters:
T - The type of object to contain.
All Superinterfaces:
Accepter<T>, java.lang.Iterable<T>, Remover<T>
All Known Subinterfaces:
KeyedContainer<T>, Layer, LayeredRenderList
All Known Implementing Classes:
BaseKeyedContainer, BlendedLayer, Cache, DefaultLayer, DefaultLayeredRenderList, FontCache, GroupedCache, ImageCache, LockingList, OrderedKeyedContainer, ParticleSprite, ParticleSprite.Images, ParticleSprite.Transforming, SoundBoard

public interface Container<T>
extends Accepter<T>, Remover<T>, java.lang.Iterable<T>

An extension of Accepter and Remover, describing an object that can keep references to objects (via add() and remove(), and then check to see if they are currently held, determine how many objects are contained, and remove all objects at once.

Author:
Chris Molini

Method Summary
 void clear()
          Removes all objects from the container.
 boolean contains(T object)
          Checks to see if the object is contained in the Container.
 int size()
          Learns how many objects are held.
 
Methods inherited from interface org.jrabbit.base.data.structures.base.Accepter
add, add
 
Methods inherited from interface org.jrabbit.base.data.structures.base.Remover
remove, remove
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

contains

boolean contains(T object)
Checks to see if the object is contained in the Container.

Parameters:
object - The object to look for.
Returns:
True if the object is in the Container, false if not.

size

int size()
Learns how many objects are held.

Returns:
The size of the Container (number of objects stored).

clear

void clear()
Removes all objects from the container.