map
Class Unit

java.lang.Object
  extended by map.Unit

public class Unit
extends java.lang.Object

A Unit is a collection of Items that may have similar properties. For example a unit contains pieces of music that sound similar. Or a Unit may contains pieces of music from the same artist. The name of a unit describes the content of the unit. In the first example a name to describe the style of the music files or a mood the the pieces fit in is chosen. In the second example the name could be the artist or the name of an album from that artist.

Author:
Hlavac Peter
See Also:
Grid

Constructor Summary
Unit(java.lang.Integer id)
          Creates a nameless Unit
Unit(java.lang.Integer id, java.lang.String name)
          Creates a labeled Unit
 
Method Summary
 void addItem(MapItem item)
          Adds an item to the itemList of the Unit
 java.lang.Integer getId()
          Gets the id of the Unit
 java.util.Vector getItemList()
          Gets the itemList of the Unit
 java.lang.String getName()
          Gets the name of the Unit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Unit

public Unit(java.lang.Integer id)
Creates a nameless Unit

Parameters:
id - The id of the Unit

Unit

public Unit(java.lang.Integer id,
            java.lang.String name)
Creates a labeled Unit

Parameters:
id - The id of the Unit
name - The name of the Unit
Method Detail

getId

public java.lang.Integer getId()
Gets the id of the Unit

Returns:
The id of the Unit

getName

public java.lang.String getName()
Gets the name of the Unit

Returns:
The name of the Unit

getItemList

public java.util.Vector getItemList()
Gets the itemList of the Unit

Returns:
The itemList of the Unit

addItem

public void addItem(MapItem item)
Adds an item to the itemList of the Unit

Parameters:
item - The item to add