net.sf.freecol.common.model
Class HistoryEvent

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.HistoryEvent

public class HistoryEvent
extends FreeColObject


Nested Class Summary
static class HistoryEvent.Type
           
 
Field Summary
private  java.lang.String[] strings
          The details of the event.
private  int turn
          The turn in which the event took place
private  HistoryEvent.Type type
          The type of event.
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, logger, PARTIAL_ATTRIBUTE
 
Constructor Summary
HistoryEvent()
           
HistoryEvent(int turn, HistoryEvent.Type type, java.lang.String... strings)
           
 
Method Summary
 java.lang.String[] getStrings()
          Get the Strings value.
 int getTurn()
          Get the int value.
 HistoryEvent.Type getType()
          Get the Type value.
static java.lang.String getXMLElementTagName()
          Returns the tag name of the root element representing this object.
protected  void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
          Initialize this object from an XML-representation of this object.
 void setStrings(java.lang.String[] newStrings)
          Set the Strings value.
 void setTurn(int newInt)
          Set the int value.
 void setType(HistoryEvent.Type newType)
          Set the Type value.
 java.lang.String toString()
           
protected  void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
          This method writes an XML-representation of this object to the given stream.
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readAttributes, readChildren, readFromArrayElement, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXML, readFromXMLElement, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, setId, toArrayElement, toArrayElement, toListElement, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

turn

private int turn
The turn in which the event took place


type

private HistoryEvent.Type type
The type of event.


strings

private java.lang.String[] strings
The details of the event.

Constructor Detail

HistoryEvent

public HistoryEvent()

HistoryEvent

public HistoryEvent(int turn,
                    HistoryEvent.Type type,
                    java.lang.String... strings)
Method Detail

getTurn

public final int getTurn()
Get the int value.

Returns:
a int value

setTurn

public final void setTurn(int newInt)
Set the int value.

Parameters:
newInt - The new int value.

getType

public final HistoryEvent.Type getType()
Get the Type value.

Returns:
a Type value

setType

public final void setType(HistoryEvent.Type newType)
Set the Type value.

Parameters:
newType - The new Type value.

getStrings

public final java.lang.String[] getStrings()
Get the Strings value.

Returns:
a String[] value

setStrings

public final void setStrings(java.lang.String[] newStrings)
Set the Strings value.

Parameters:
newStrings - The new Strings value.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toXMLImpl

protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
                  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 FreeColObject
Parameters:
out - The target stream.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

readFromXMLImpl

protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
                        throws javax.xml.stream.XMLStreamException
Initialize this object from an XML-representation of this object.

Overrides:
readFromXMLImpl in class FreeColObject
Parameters:
in - The input stream with the XML.
Throws:
javax.xml.stream.XMLStreamException - if a problem was encountered during parsing.

getXMLElementTagName

public static java.lang.String getXMLElementTagName()
Returns the tag name of the root element representing this object.

Returns:
the tag name.