net.sf.freecol.common.model
Interface Location

All Known Implementing Classes:
Building, Colony, ColonyTile, Europe, GoodsLocation, HighSeas, IndianSettlement, Map, ServerBuilding, ServerColony, ServerColonyTile, ServerEurope, ServerIndianSettlement, ServerUnit, Settlement, Tile, Unit, UnitLocation, WorkLocation

public interface Location

A place where a Locatable can be put.

See Also:
Locatable

Method Summary
 boolean add(Locatable locatable)
          Adds a Locatable to this Location.
 boolean canAdd(Locatable locatable)
          Checks whether or not the specified locatable may be added to this Location.
 boolean contains(Locatable locatable)
          Checks if this Location contains the specified Locatable.
 Colony getColony()
          Returns the Colony this Location is located in.
 GoodsContainer getGoodsContainer()
          Gets the GoodsContainer this Location use for storing it's goods.
 java.lang.String getId()
          Gets the ID of this Location.
 StringTemplate getLocationName()
          Returns the name of this location.
 StringTemplate getLocationNameFor(Player player)
          Returns the name of this location for a particular player.
 Settlement getSettlement()
          Returns the Settlement this Location is located in.
 Tile getTile()
          Returns the Tile where this Location is located.
 int getUnitCount()
          Returns the amount of Units at this Location.
 java.util.Iterator<Unit> getUnitIterator()
          Gets a Iterator of every Unit directly located on this Location.
 java.util.List<Unit> getUnitList()
          Returns a list containing all the Units present at this Location.
 boolean remove(Locatable locatable)
          Removes a Locatable from this Location.
 

Method Detail

getTile

Tile getTile()
Returns the Tile where this Location is located. Or null if no Tile applies.

Returns:
The Tile where this Location is located. Or null if no Tile applies.

getLocationName

StringTemplate getLocationName()
Returns the name of this location.

Returns:
The name of this location.

getLocationNameFor

StringTemplate getLocationNameFor(Player player)
Returns the name of this location for a particular player.

Parameters:
player - The Player to return the name for.
Returns:
The name of this location.

add

boolean add(Locatable locatable)
Adds a Locatable to this Location.

Parameters:
locatable - The Locatable to add to this Location.

remove

boolean remove(Locatable locatable)
Removes a Locatable from this Location.

Parameters:
locatable - The Locatable to remove from this Location.

contains

boolean contains(Locatable locatable)
Checks if this Location contains the specified Locatable.

Parameters:
locatable - The Locatable to test the presence of.
Returns:
  • true if the specified Locatable is on this Location and
  • false otherwise.

canAdd

boolean canAdd(Locatable locatable)
Checks whether or not the specified locatable may be added to this Location.

Parameters:
locatable - The Locatable to add.
Returns:
The result.

getUnitCount

int getUnitCount()
Returns the amount of Units at this Location.

Returns:
The amount of Units at this Location.

getUnitList

java.util.List<Unit> getUnitList()
Returns a list containing all the Units present at this Location.

Returns:
a list containing the Units present at this location.

getUnitIterator

java.util.Iterator<Unit> getUnitIterator()
Gets a Iterator of every Unit directly located on this Location.

Returns:
The Iterator.

getId

java.lang.String getId()
Gets the ID of this Location.

Returns:
The ID.
See Also:
FreeColObject.getId()

getGoodsContainer

GoodsContainer getGoodsContainer()
Gets the GoodsContainer this Location use for storing it's goods.

Returns:
The GoodsContainer or null if the Location cannot store any goods.

getSettlement

Settlement getSettlement()
Returns the Settlement this Location is located in.

Returns:
The current Settlement or null if none.

getColony

Colony getColony()
Returns the Colony this Location is located in.

Returns:
The current Colony or null if none.