org.vizzini.util
Class AbstractMap

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

public abstract class AbstractMap
extends AbstractCollection

Provides base functionality for maps in the game framework.

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

Constructor Summary
AbstractMap()
           
 
Method Summary
 boolean add(Object object)
          Add the given object.
 void clear()
          Removes all of the objects from this collection.
 boolean contains(Object object)
          Returns true if this collection contains the given object.
 boolean equals(Object object)
          Return true if the given object is equal to this.
protected abstract  Map getData()
          Return the data collection.
protected abstract  Object getKey(Object object)
          Return the key for the given object.
 int hashCode()
          Returns a hash code value for the object.
 boolean isEmpty()
          Return true if this is empty.
 Iterator iterator()
          Return an iterator over the object collection.
 boolean remove(Object object)
          Removes a single instance of the given object from this collection, if it is present.
 int size()
          Return the size of this collection.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class org.vizzini.util.AbstractCollection
addAll, containsAll, getType, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMap

public AbstractMap()
Method Detail

isEmpty

public boolean isEmpty()
Return true if this is empty.

Since:
v0.1

add

public boolean add(Object object)
Add the given object.

Since:
v0.1

clear

public void clear()
Removes all of the objects from this collection.

Since:
v0.1

contains

public boolean contains(Object object)
Returns true if this collection contains the given object.

Since:
v0.1

equals

public boolean equals(Object object)
Return true if the given object is equal to this.

Specified by:
equals in interface Collection
Overrides:
equals in class Object
Parameters:
object - The object to compare.
Since:
v0.1

hashCode

public int hashCode()
Returns a hash code value for the object.

Specified by:
hashCode in interface Collection
Overrides:
hashCode in class Object
Since:
v0.1

iterator

public Iterator iterator()
Return an iterator over the object collection.

Since:
v0.1

remove

public boolean remove(Object object)
Removes a single instance of the given object from this collection, if it is present.

Since:
v0.1

size

public int size()
Return the size of this 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 AbstractCollection
Since:
v0.2

getData

protected abstract Map getData()
Return the data collection.

Since:
v0.1

getKey

protected abstract Object getKey(Object object)
Return the key for the given object.

Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02