de.adom.jade.world.maps
Class AreaList

java.lang.Object
  extended by de.adom.jade.world.maps.AreaList
All Implemented Interfaces:
java.io.Serializable

public class AreaList
extends java.lang.Object
implements java.io.Serializable

Collects a list of areas the occupy the same location.

See Also:
Serialized Form

Constructor Summary
AreaList()
          Creates a new area list.
AreaList(Area area)
          Creates a new area list.
 
Method Summary
 void add(Area area)
          Adds a new area to this list.
 boolean contains(Area area)
          Tests whether a given area is contained in this list.
 Area getArea(int index)
          Returns a specific area from the area list.
 int getAreaCount()
          Returns the number of areas in this list.
static AreaList mergeUniqueAreas(AreaList list1, AreaList list2)
          Merges two area lists by creating a new list that contains only those areas that exist in but one of the two lists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AreaList

public AreaList(Area area)
Creates a new area list.

Parameters:
area - the first area to add to the list

AreaList

public AreaList()
Creates a new area list.

Method Detail

add

public void add(Area area)
Adds a new area to this list.

Parameters:
area - the area to list

getAreaCount

public int getAreaCount()
Returns the number of areas in this list.

Returns:
the number of areas in this list

getArea

public Area getArea(int index)
Returns a specific area from the area list.

Parameters:
index - the index of the area
Returns:
the area with the given index

contains

public boolean contains(Area area)
Tests whether a given area is contained in this list.

Parameters:
area - the area to check
Returns:
a boolean value indicating whether the given area exists in this list

mergeUniqueAreas

public static AreaList mergeUniqueAreas(AreaList list1,
                                        AreaList list2)
Merges two area lists by creating a new list that contains only those areas that exist in but one of the two lists.

Parameters:
list1 - the first area list
list2 - the second area list
Returns:
the merged area lists