net.sf.freecol.common.model
Class HighSeas

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.FreeColGameObject
          extended by net.sf.freecol.common.model.UnitLocation
              extended by net.sf.freecol.common.model.HighSeas
All Implemented Interfaces:
Location

public class HighSeas
extends UnitLocation


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.freecol.common.model.UnitLocation
UnitLocation.NoAddReason
 
Field Summary
private  java.util.List<Location> destinations
          The destinations this HighSeas object connects.
private static java.util.logging.Logger logger
           
 
Fields inherited from class net.sf.freecol.common.model.FreeColGameObject
UNITS_TAG_NAME
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG
 
Constructor Summary
HighSeas(Game game)
           
HighSeas(Game game, java.lang.String id)
           
HighSeas(Game game, javax.xml.stream.XMLStreamReader in)
           
 
Method Summary
 void addDestination(Location destination)
          Add a single destination to this HighSeas instance.
 boolean canAdd(Locatable locatable)
          Checks whether or not the specified locatable may be added to this Location.
 java.util.List<Location> getDestinations()
          Get the Destinations value.
 StringTemplate getLocationName()
          Returns the name of this location.
static java.lang.String getXMLElementTagName()
          Returns the tag name of this Object.
protected  void readChild(javax.xml.stream.XMLStreamReader in)
          Reads a single child object.
protected  void readChildren(javax.xml.stream.XMLStreamReader in)
          Reads the children of this object from an XML stream.
 void removeDestination(Location destination)
          Remove a single destination from this HighSeas instance.
protected  void toXMLImpl(javax.xml.stream.XMLStreamWriter out, Player player, boolean showAll, boolean toSavedGame)
          This method writes an XML-representation of this object to the given stream.
protected  void writeChildren(javax.xml.stream.XMLStreamWriter out, Player player, boolean showAll, boolean toSavedGame)
          Serialize the children of this UnitLocation, i.e.
 
Methods inherited from class net.sf.freecol.common.model.UnitLocation
add, contains, dispose, disposeList, getColony, getGoodsContainer, getLocationNameFor, getNoAddReason, getSettlement, getSpaceTaken, getTile, getUnitCapacity, getUnitCount, getUnitIterator, getUnitList, isEmpty, isFull, remove, writeAttributes
 
Methods inherited from class net.sf.freecol.common.model.FreeColGameObject
equals, equals, fundamentalDispose, getFreeColGameObject, getFreeColGameObject, getGame, getIntegerID, getSpecification, hashCode, isDisposed, isUninitialized, newLocation, readFromXML, readFromXMLPartialByClass, setDefaultId, setGame, setId, toString, toXML, toXMLImpl, toXMLPartialByClass, updateFreeColGameObject
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, dumpObject, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readAttributes, readAttributes, readChild, readChildren, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXMLElement, readFromXMLImpl, readFromXMLImpl, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, save, save, setSpecification, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeChildren
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.freecol.common.model.Location
getId
 

Field Detail

logger

private static final java.util.logging.Logger logger

destinations

private java.util.List<Location> destinations
The destinations this HighSeas object connects.

Constructor Detail

HighSeas

public HighSeas(Game game)

HighSeas

public HighSeas(Game game,
                javax.xml.stream.XMLStreamReader in)
         throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

HighSeas

public HighSeas(Game game,
                java.lang.String id)
Method Detail

getLocationName

public StringTemplate getLocationName()
Returns the name of this location.

Specified by:
getLocationName in interface Location
Overrides:
getLocationName in class UnitLocation
Returns:
The name of this location.

getDestinations

public final java.util.List<Location> getDestinations()
Get the Destinations value.

Returns:
a List value

addDestination

public void addDestination(Location destination)
Add a single destination to this HighSeas instance.

Parameters:
destination - a Location value

removeDestination

public void removeDestination(Location destination)
Remove a single destination from this HighSeas instance.

Parameters:
destination - a Location value

canAdd

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

Specified by:
canAdd in interface Location
Overrides:
canAdd in class UnitLocation
Parameters:
locatable - The Locatable to add.
Returns:
The result.

toXMLImpl

protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out,
                         Player player,
                         boolean showAll,
                         boolean toSavedGame)
                  throws javax.xml.stream.XMLStreamException
This method writes an XML-representation of this object to the given stream.

Only attributes visible to the given Player will be added to that representation if showAll is set to false.

Specified by:
toXMLImpl in class FreeColGameObject
Parameters:
out - The target stream.
player - The Player this XML-representation should be made for, or null if showAll == true.
showAll - Only attributes visible to player will be added to the representation if showAll is set to false.
toSavedGame - If true then information that is only needed when saving a game is added.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

writeChildren

protected void writeChildren(javax.xml.stream.XMLStreamWriter out,
                             Player player,
                             boolean showAll,
                             boolean toSavedGame)
                      throws javax.xml.stream.XMLStreamException
Serialize the children of this UnitLocation, i.e. the Units themselves.

Overrides:
writeChildren in class UnitLocation
Parameters:
out - a XMLStreamWriter value
player - a Player value
showAll - a boolean value
toSavedGame - a boolean value
Throws:
javax.xml.stream.XMLStreamException - if an error occurs

readChildren

protected void readChildren(javax.xml.stream.XMLStreamReader in)
                     throws javax.xml.stream.XMLStreamException
Reads the children of this object from an XML stream.

Overrides:
readChildren in class UnitLocation
Parameters:
in - The XML input stream.
Throws:
javax.xml.stream.XMLStreamException - if a problem was encountered during parsing.

readChild

protected void readChild(javax.xml.stream.XMLStreamReader in)
                  throws javax.xml.stream.XMLStreamException
Reads a single child object. This method does calls readChild with a null specification parameter.

Overrides:
readChild in class UnitLocation
Parameters:
in - The XML input stream.
Throws:
javax.xml.stream.XMLStreamException - if an error occurs

getXMLElementTagName

public static java.lang.String getXMLElementTagName()
Returns the tag name of this Object.

Returns:
"highSeas"