Package net.sf.freecol.common.model
Class Settlement
- java.lang.Object
-
- net.sf.freecol.common.model.FreeColObject
-
- net.sf.freecol.common.model.FreeColGameObject
-
- net.sf.freecol.common.model.UnitLocation
-
- net.sf.freecol.common.model.GoodsLocation
-
- net.sf.freecol.common.model.Settlement
-
- All Implemented Interfaces:
java.lang.Comparable<FreeColObject>,Location,Nameable,Ownable,ObjectWithId
- Direct Known Subclasses:
Colony,IndianSettlement
public abstract class Settlement extends GoodsLocation implements Nameable, Ownable
The super class of all settlements on the map (that is colonies and indian settlements).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.freecol.common.model.UnitLocation
UnitLocation.NoAddReason
-
-
Field Summary
Fields Modifier and Type Field Description private FeatureContainerfeatureContainerContains the abilities and modifiers of this Settlement.static intFOOD_PER_COLONISTprivate static java.util.logging.Loggerloggerprivate java.lang.StringnameThe name of the Settlement.private static java.lang.StringNAME_TAGprivate java.util.Set<Tile>ownedTilesThe tiles this settlement owns.protected PlayerownerThePlayerowning thisSettlement.private static java.lang.StringOWNER_TAGprivate static java.lang.StringSETTLEMENT_TYPE_TAGprotected TiletileTheTilewhere thisSettlementis located.private static java.lang.StringTILE_TAGprivate SettlementTypetypeThe type of settlement.-
Fields inherited from class net.sf.freecol.common.model.FreeColGameObject
initialized
-
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE_TAG, DEFAULT_CLASS_INDEX, fcoComparator, ID_ATTRIBUTE_TAG, PARTIAL_ATTRIBUTE_TAG, VALUE_TAG
-
Fields inherited from interface net.sf.freecol.common.model.Location
LOCATION_RANK_EUROPE, LOCATION_RANK_HIGHSEAS, LOCATION_RANK_NOWHERE
-
-
Constructor Summary
Constructors Modifier Constructor Description Settlement(Game game, java.lang.String id)Initiates a newSettlementwith the given identifier.protectedSettlement(Game game, Player owner, java.lang.String name, Tile tile)Create a newSettlement.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddTile(Tile tile)Adds a tile to this settlement.abstract intcalculateSettlementValue(int value, Unit unit)Get the value of attacking aSettlementbooleancanBombardEnemyShip()Check if colony has the ability to bombard an enemy ship adjacent to it.RolecanImproveUnitMilitaryRole(Unit unit)Can this settlement provide the goods to improve a given unit's role?protected booleancanProvideGoods(java.util.List<AbstractGoods> goods)Determines if this settlement can build the given type of equipment.voidchangeOwner(Player newOwner)Change the owner of thisSettlement.private voidchangeType(SettlementType newType)Change the settlement type, setting the consequent features.Constants.IntegrityTypecheckIntegrity(boolean fix, LogBuilder lb)Checks the integrity of this game object.<T extends FreeColObject>
booleancopyIn(T other)Copy another FreeColObject into this one if it is compatible.voiddisposeResources()Dispose of the resources of this object, and finally remove it from the game.booleanequipForRole(Unit unit, Role role, int roleCount)Equip a unit for a role using resources at this location.voidexciseSettlement()Remove a settlement from the map.abstract StringTemplategetAlarmLevelLabel(Player player)Gets a label indicating the alarm level at this settlement with respect to another player.java.util.List<Unit>getAllUnitsList()Get all the units present here.protected intgetConsumptionOf(java.util.List<GoodsType> goodsTypes)Returns the number of goods of all given types used by the settlement each turn.protected intgetConsumptionOf(GoodsType goodsType)Returns the number of goods of a given type used by the settlement each turn.abstract doublegetDefenceRatio()Get the ratio between defence at this settlement, and the general settlement size.abstract UnitgetDefendingUnit(Unit attacker)Gets theUnitthat is currently defending thisSettlement.FeatureContainergetFeatureContainer()Gets the feature container for this object, if any.intgetFoodConsumption()Gives the food needed to keep all units alive in this Settlement.intgetHighSeasCount()Gets the minimum high seas count of the adjacent high-seas-connected tiles.intgetImmigration()Gets the immigration points.intgetLiberty()Gets the liberty points.intgetLineOfSight()Gets this settlement's line of sight value.FreeColGameObjectgetLinkTarget(Player player)Get a suitable game object to use as a clickable link in messages to a player.java.lang.StringgetLocationImageKey()Get an image key for this location.StringTemplategetLocationLabel()Get a label for this location.java.lang.StringgetName()Get the name of thisSettlement.UnitLocation.NoAddReasongetNoAddReason(Locatable locatable)Gets the reason why a givenLocatablecan not be added to this Location.java.util.Set<Tile>getOwnedTiles()Get the tiles this settlement owns.PlayergetOwner()Gets the owner of thisOwnable.intgetPlunder(Unit attacker, java.util.Random random)Gets an amount of plunder when this settlement is taken.abstract RandomRangegetPlunderRange(Unit attacker)Gets the range of gold plunderable when this settlement is captured.intgetRadius()Gets the radius of what theSettlementconsiders as it's own land.intgetRank()Get a integer for this location, for the benefit of location comparators.SettlementgetSettlement()Gets theSettlementthisLocationis located in.abstract intgetSoL()Gets the current Sons of Liberty in this settlement.TilegetTile()Gets the Tile associated with this Location.abstract intgetTotalProductionOf(GoodsType goodsType)Gets the total production of the given type of goods in this settlement.SettlementTypegetType()Get the type of this settlement.abstract intgetUpkeep()Get the amount of gold necessary to maintain all of the settlement's buildings.java.util.Set<Tile>getVisibleTileSet()Get the tiles visible from this settlement.intgetWarehouseCapacity()Gets the storage capacity of this settlement.abstract booleanhasContacted(Player player)Has this settlement contacted a given player? Allow player == null as this is true in the map editor where the user player is moot.abstract booleanisBadlyDefended()Is this settlement insufficiently defended?booleanisCapital()Is this a national capital?booleanisConnectedPort()Gets whether this settlement is connected to the high seas.booleanisLandLocked()Is this settlement landlocked?voidplaceSettlement(boolean maximal)Put a prepared settlement onto the map.intpriceGoods(java.util.List<AbstractGoods> goods)What would the price be for a collection of goods at this location?protected voidreadAttributes(FreeColXMLReader xr)Reads the attributes of this object from an XML stream.protected voidreadChild(FreeColXMLReader xr)Reads a single child object.protected voidreadChildren(FreeColXMLReader xr)Reads the children of this object from an XML stream.voidremoveTile(Tile tile)Removes a tile from this settlement.voidsetCapital(boolean capital)voidsetName(java.lang.String newName)Sets the name of thisSettlement.protected voidsetOwnedTiles(java.util.Collection<Tile> ownedTiles)Set the owned tiles set.voidsetOwner(Player player)Sets the owner of thisOwnable.voidsetType(SettlementType newType)Set the settlement type.protected voidwriteAttributes(FreeColXMLWriter xw)Write the attributes of this object to a stream.protected voidwriteChildren(FreeColXMLWriter xw)Write the children of this object to a stream.-
Methods inherited from class net.sf.freecol.common.model.GoodsLocation
add, addGoods, addGoods, addGoods, contains, containsGoods, getCompactGoodsList, getDisposables, getGoodsCapacity, getGoodsContainer, getGoodsCount, getGoodsList, invalidateCache, moveGoods, remove, removeAll, removeGoods, removeGoods, removeGoods, setGoodsContainer
-
Methods inherited from class net.sf.freecol.common.model.UnitLocation
canAdd, clearUnitList, getCarrierForUnit, getColony, getFirstUnit, getIndianSettlement, getLastUnit, getLocationLabelFor, getNavalUnits, getSpaceTaken, getTotalUnitCount, getUnitCapacity, getUnitCount, getUnitList, getUnits, hasCarrierWithSpace, intern, isEmpty, isFull, moveToFront
-
Methods inherited from class net.sf.freecol.common.model.FreeColGameObject
dispose, equals, fundamentalDispose, getClassIndex, getGame, getSpecification, hashCode, internId, isDisposed, isInitialized, isInternable, readFromXML, setGame, setSpecification
-
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addAbility, addFeatures, addModifier, addPropertyChangeListener, addPropertyChangeListener, apply, apply, applyModifiers, applyModifiers, arrayKey, compareIds, compareTo, containsAbilityKey, containsModifierKey, copy, copy, copy, copy, copyInCast, dumpObject, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAbilities, getAbilities, getAbilities, getAbilities, getDefenceModifiers, getDisplayObject, getFreeColObjectClass, getFreeColObjectClassByName, getId, getIdNumber, getIdType, getIdTypeByName, getModifiers, getModifiers, getModifiers, getModifiers, getObjectClassIndex, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getSortedAbilities, getSortedModifiers, getSuffix, getSuffix, getXMLTagName, hasAbility, hasAbility, hasAbility, hasListeners, hasModifier, hasModifier, hasModifier, idEquals, invokeMethod, logFreeColObjects, readFromXMLPartial, removeAbilities, removeAbility, removeFeatures, removeModifier, removeModifiers, removePropertyChangeListener, removePropertyChangeListener, save, save, save, save, serialize, serialize, serialize, serialize, setId, toString, toXML, toXML, toXMLPartial, toXMLPartial
-
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, toShortString, up
-
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
FOOD_PER_COLONIST
public static final int FOOD_PER_COLONIST
- See Also:
- Constant Field Values
-
type
private SettlementType type
The type of settlement.
-
owner
protected Player owner
ThePlayerowning thisSettlement.
-
name
private java.lang.String name
The name of the Settlement.
-
tile
protected Tile tile
TheTilewhere thisSettlementis located.
-
ownedTiles
private final java.util.Set<Tile> ownedTiles
The tiles this settlement owns.
-
featureContainer
private final FeatureContainer featureContainer
Contains the abilities and modifiers of this Settlement.
-
NAME_TAG
private static final java.lang.String NAME_TAG
- See Also:
- Constant Field Values
-
OWNER_TAG
private static final java.lang.String OWNER_TAG
- See Also:
- Constant Field Values
-
SETTLEMENT_TYPE_TAG
private static final java.lang.String SETTLEMENT_TYPE_TAG
- See Also:
- Constant Field Values
-
TILE_TAG
private static final java.lang.String TILE_TAG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Settlement
protected Settlement(Game game, Player owner, java.lang.String name, Tile tile)
Create a newSettlement.- Parameters:
game- The enclosingGame.owner- The owningPlayer.name- The settlement name.tile- The containingTile.
-
Settlement
public Settlement(Game game, java.lang.String id)
Initiates a newSettlementwith the given identifier. The object should be initialized later.- Parameters:
game- The enclosingGame.id- The object identifier.
-
-
Method Detail
-
getType
public final SettlementType getType()
Get the type of this settlement.- Returns:
- The settlement type.
-
setType
public void setType(SettlementType newType)
Set the settlement type.- Parameters:
newType- The newSettlementType.
-
getImmigration
public int getImmigration()
Gets the immigration points.- Returns:
- The current immigration.
-
getLiberty
public int getLiberty()
Gets the liberty points.- Returns:
- The current liberty.
-
isLandLocked
public boolean isLandLocked()
Is this settlement landlocked?- Returns:
- True if no adjacent tiles are water.
-
changeType
private final void changeType(SettlementType newType)
Change the settlement type, setting the consequent features.- Parameters:
newType- The newSettlementType.
-
isCapital
public boolean isCapital()
Is this a national capital?- Returns:
- True if this is a national capital.
-
setCapital
public void setCapital(boolean capital)
-
getOwnedTiles
public java.util.Set<Tile> getOwnedTiles()
Get the tiles this settlement owns.- Returns:
- A set of tiles.
-
setOwnedTiles
protected void setOwnedTiles(java.util.Collection<Tile> ownedTiles)
Set the owned tiles set.- Parameters:
ownedTiles- The new set of ownedTiles.
-
addTile
public void addTile(Tile tile)
Adds a tile to this settlement. We can not clear the settlement owned tiles container when the settlement is read because this is called when the Tile is read, and tiles can appear before and after the settlement in the map definition. So we just accumulate and defend against duplicates.- Parameters:
tile- TheTileto add.
-
removeTile
public void removeTile(Tile tile)
Removes a tile from this settlement.- Parameters:
tile- TheTileto remove.
-
getRadius
public int getRadius()
Gets the radius of what theSettlementconsiders as it's own land.- Returns:
- Settlement radius
-
getLineOfSight
public int getLineOfSight()
Gets this settlement's line of sight value.- Returns:
- The line of sight value.
-
getPlunder
public int getPlunder(Unit attacker, java.util.Random random)
Gets an amount of plunder when this settlement is taken.- Parameters:
attacker- TheUnitthat takes the settlement.random- A pseudo-random number source.- Returns:
- An amount of gold plundered.
-
getVisibleTileSet
public java.util.Set<Tile> getVisibleTileSet()
Get the tiles visible from this settlement.- Returns:
- A set of visible tiles.
-
placeSettlement
public void placeSettlement(boolean maximal)
Put a prepared settlement onto the map. -vis: Several visibility issues accumulated here. -til: Several tile appearance issues accumulated here.- Parameters:
maximal- If true, also claim all the tiles possible.
-
exciseSettlement
public void exciseSettlement()
Remove a settlement from the map. -vis: Visibility reduced when settlement goes away. -til: Several tile appearance issues accumulated here. Several visibility issues accumulated here.
-
changeOwner
public void changeOwner(Player newOwner)
Change the owner of thisSettlement. Does not fix up the units! That is handled in the server. -vis: Changes visibility. -til: Changes tile appearance.- Parameters:
newOwner- ThePlayerthat shall own thisSettlement.- See Also:
getOwner()
-
isConnectedPort
public boolean isConnectedPort()
Gets whether this settlement is connected to the high seas. This is more than merely non-landlocked, because the settlement could be on an inland lake.- Returns:
- True if the settlement is connected to the high seas.
-
getHighSeasCount
public int getHighSeasCount()
Gets the minimum high seas count of the adjacent high-seas-connected tiles. This is a measure of how close this settlement is to Europe.- Returns:
- A high seas count, INFINITY if not connected.
-
getConsumptionOf
protected int getConsumptionOf(GoodsType goodsType)
Returns the number of goods of a given type used by the settlement each turn.- Parameters:
goodsType- aGoodsTypevalue- Returns:
- an
intvalue
-
getConsumptionOf
protected int getConsumptionOf(java.util.List<GoodsType> goodsTypes)
Returns the number of goods of all given types used by the settlement each turn.- Parameters:
goodsTypes-GoodsTypevalues- Returns:
- an
intvalue
-
getFoodConsumption
public int getFoodConsumption()
Gives the food needed to keep all units alive in this Settlement.- Returns:
- The amount of food eaten in this colony each this turn.
-
canProvideGoods
protected boolean canProvideGoods(java.util.List<AbstractGoods> goods)
Determines if this settlement can build the given type of equipment. Unlike priceGoods, this takes goods "reserved" for other purposes into account (e.g. breeding).- Parameters:
goods- A list ofAbstractGoods- Returns:
- True if the settlement can provide the equipment.
-
getWarehouseCapacity
public int getWarehouseCapacity()
Gets the storage capacity of this settlement.- Returns:
- The storage capacity of this settlement.
- See Also:
GoodsLocation.getGoodsCapacity()
-
canBombardEnemyShip
public boolean canBombardEnemyShip()
Check if colony has the ability to bombard an enemy ship adjacent to it. Only sea-side colonies can bombard. Does it have the buildings that give such abilities?- Returns:
- True if bombarding is allowed.
-
canImproveUnitMilitaryRole
public Role canImproveUnitMilitaryRole(Unit unit)
Can this settlement provide the goods to improve a given unit's role?- Parameters:
unit- TheUnitto check.- Returns:
- The
Rolethat this settlement could provide.
-
getAllUnitsList
public java.util.List<Unit> getAllUnitsList()
Get all the units present here. That is, not just the units in the settlement but also the units on the tile.- Returns:
- A list of
Units.
-
getLinkTarget
public FreeColGameObject getLinkTarget(Player player)
Get a suitable game object to use as a clickable link in messages to a player. Objects do not have links by default, hence the null return here. However, for example, a player's colony should return itself as a link target.- Overrides:
getLinkTargetin classFreeColGameObject- Parameters:
player- ThePlayerto make a link for.- Returns:
- A suitable link target if available, although usually null.
-
getFeatureContainer
public FeatureContainer getFeatureContainer()
Gets the feature container for this object, if any.- Overrides:
getFeatureContainerin classFreeColObject- Returns:
- The
FeatureContainerfor this object.
-
disposeResources
public void disposeResources()
Dispose of the resources of this object, and finally remove it from the game. To be extended by subclasses, but they must tail call up towards this. -vis: Visibility changes when the settlement is removed.- Overrides:
disposeResourcesin classUnitLocation
-
getName
public java.lang.String getName()
Get the name of thisSettlement.
-
setName
public void setName(java.lang.String newName)
Sets the name of thisSettlement. -til: Changes the tile appearance.
-
getOwner
public Player getOwner()
Gets the owner of thisOwnable.
-
setOwner
public void setOwner(Player player)
Sets the owner of thisOwnable. -vis: Changes visibility. -til: Changes tile appearance.
-
getTile
public final Tile getTile()
Gets the Tile associated with this Location.- Specified by:
getTilein interfaceLocation- Overrides:
getTilein classUnitLocation- Returns:
- The Tile associated with this Location, or null if none found.
-
getLocationLabel
public StringTemplate getLocationLabel()
Get a label for this location.- Specified by:
getLocationLabelin interfaceLocation- Overrides:
getLocationLabelin classUnitLocation- Returns:
- A label for this location.
-
getSettlement
public final Settlement getSettlement()
Gets theSettlementthisLocationis located in.- Specified by:
getSettlementin interfaceLocation- Overrides:
getSettlementin classUnitLocation- Returns:
- The associated
Settlement, or null if none.
-
getRank
public final int getRank()
Get a integer for this location, for the benefit of location comparators.
-
getLocationImageKey
public java.lang.String getLocationImageKey()
Get an image key for this location.- Specified by:
getLocationImageKeyin interfaceLocation- Returns:
- A key for image lookup, null by default.
-
getNoAddReason
public UnitLocation.NoAddReason getNoAddReason(Locatable locatable)
Gets the reason why a givenLocatablecan not be added to this Location. Be careful to test for unit presence last before success (NoAddReason.NONE) except perhaps for the capacity test, so that we can treat ALREADY_PRESENT as success in some cases (e.g. if the unit changes type --- does it still have a required skill?) FIXME: consider moving this up to Location?- Overrides:
getNoAddReasonin classGoodsLocation- Parameters:
locatable- TheLocatableto test.- Returns:
- The reason why adding would fail.
-
priceGoods
public int priceGoods(java.util.List<AbstractGoods> goods) throws FreeColException
What would the price be for a collection of goods at this location?- Overrides:
priceGoodsin classUnitLocation- Parameters:
goods- The list ofAbstractGoodsto check for.- Returns:
- The net cost of acquiring the goods at this location.
- Throws:
FreeColException- if the goods are unavailable for any reason.
-
equipForRole
public boolean equipForRole(Unit unit, Role role, int roleCount)
Equip a unit for a role using resources at this location.- Overrides:
equipForRolein classUnitLocation- Parameters:
unit- TheUnitto equip.role- TheRoleto build for.roleCount- The role count.- Returns:
- True if the equipping succeeded.
-
getDefendingUnit
public abstract Unit getDefendingUnit(Unit attacker)
Gets theUnitthat is currently defending thisSettlement.- Parameters:
attacker- TheUnitthat is attacking thisSettlement.- Returns:
- The
Unitthat has been chosen to defend thisSettlement.
-
getDefenceRatio
public abstract double getDefenceRatio()
Get the ratio between defence at this settlement, and the general settlement size.- Returns:
- A ratio of defence power to settlement size.
-
isBadlyDefended
public abstract boolean isBadlyDefended()
Is this settlement insufficiently defended?- Returns:
- True if this settlement needs more defence.
-
getPlunderRange
public abstract RandomRange getPlunderRange(Unit attacker)
Gets the range of gold plunderable when this settlement is captured.- Parameters:
attacker- TheUnitthat takes the settlement.- Returns:
- A
RandomRangeencapsulating the range of plunder available.
-
getSoL
public abstract int getSoL()
Gets the current Sons of Liberty in this settlement.- Returns:
- The current SoL.
-
getUpkeep
public abstract int getUpkeep()
Get the amount of gold necessary to maintain all of the settlement's buildings.- Returns:
- The gold required for upkeep.
-
getTotalProductionOf
public abstract int getTotalProductionOf(GoodsType goodsType)
Gets the total production of the given type of goods in this settlement.- Parameters:
goodsType- The type of goods to get the production for.- Returns:
- The total production of the given type of goods.
-
hasContacted
public abstract boolean hasContacted(Player player)
Has this settlement contacted a given player? Allow player == null as this is true in the map editor where the user player is moot.- Parameters:
player- The otherPlayerto check.- Returns:
- True if the settlement has contacted the player.
-
getAlarmLevelLabel
public abstract StringTemplate getAlarmLevelLabel(Player player)
Gets a label indicating the alarm level at this settlement with respect to another player.- Parameters:
player- The otherPlayer.- Returns:
- A
StringTemplatedescribing the alarm.
-
calculateSettlementValue
public abstract int calculateSettlementValue(int value, Unit unit)Get the value of attacking aSettlement- Parameters:
value- The previously calculated input value from#scoreSettlementPath(AIUnit, PathNode, Settlement)unit- The Unit doing the attacking.- Returns:
- The calculated value
-
checkIntegrity
public Constants.IntegrityType checkIntegrity(boolean fix, LogBuilder lb)
Checks the integrity of this game object.- Overrides:
checkIntegrityin classFreeColGameObject- Parameters:
fix- If true, fix problems if possible.lb- ALogBuilderto log to.- Returns:
- A suitable
IntegrityType.
-
copyIn
public <T extends FreeColObject> boolean copyIn(T other)
Copy another FreeColObject into this one if it is compatible.- Overrides:
copyInin classGoodsLocation- Type Parameters:
T- TheFreeColObjectsubclass of the object to copy in.- Parameters:
other- The other object.- Returns:
- True if the copy in is succesful.
-
writeAttributes
protected void writeAttributes(FreeColXMLWriter xw) throws javax.xml.stream.XMLStreamException
Write the attributes of this object to a stream. To be overridden if required by any object that has attributes and uses the toXML(FreeColXMLWriter, String) call.- Overrides:
writeAttributesin classFreeColObject- Parameters:
xw- TheFreeColXMLWriterto write to.- Throws:
javax.xml.stream.XMLStreamException- if there are any problems writing to the stream.
-
writeChildren
protected void writeChildren(FreeColXMLWriter xw) throws javax.xml.stream.XMLStreamException
Write the children of this object to a stream. To be overridden if required by any object that has children and uses the toXML(FreeColXMLWriter, String) call.- Overrides:
writeChildrenin classGoodsLocation- Parameters:
xw- TheFreeColXMLWriterto write to.- Throws:
javax.xml.stream.XMLStreamException- if there are any problems writing to the stream.
-
readAttributes
protected void readAttributes(FreeColXMLReader xr) throws javax.xml.stream.XMLStreamException
Reads the attributes of this object from an XML stream.- Overrides:
readAttributesin classFreeColGameObject- Parameters:
xr- TheFreeColXMLReaderto read from.- Throws:
javax.xml.stream.XMLStreamException- if there is a problem reading the stream.
-
readChildren
protected void readChildren(FreeColXMLReader xr) throws javax.xml.stream.XMLStreamException
Reads the children of this object from an XML stream.- Overrides:
readChildrenin classGoodsLocation- Parameters:
xr- TheFreeColXMLReaderto read from.- Throws:
javax.xml.stream.XMLStreamException- if there is a problem reading the stream.
-
readChild
protected void readChild(FreeColXMLReader xr) throws javax.xml.stream.XMLStreamException
Reads a single child object. Subclasses must override to read their enclosed elements. This particular instance of the routine always throws XMLStreamException because we should never arrive here. However it is very useful to always call super.readChild() when an unexpected tag is encountered, as the exception thrown here provides some useful debugging context.- Overrides:
readChildin classGoodsLocation- Parameters:
xr- TheFreeColXMLReaderto read from.- Throws:
javax.xml.stream.XMLStreamException- if there is a problem reading the stream.
-
-