de.hattrickorganizer.model
Class FormulaFactors

java.lang.Object
  extended by de.hattrickorganizer.model.FormulaFactors

public class FormulaFactors
extends java.lang.Object

DOCUMENT ME!

Author:
thomas.werth

Field Summary
protected static int ANZ_FAKTOROBJEKTE
          Konstante wieviel PositionsObjekte es gibt
protected static FormulaFactors m_clInstance
          singelton
 
Method Summary
 FactorObject[] getAllObj()
          liefert Array mit allen Objekten
static java.util.Date getLastChange()
          Get last change date
 FactorObject getPositionFactor(byte playerPosition)
          Return a FactorObject for hoPosition
 void importDefaults()
          Import star formulas from the default XML.
 void init()
          Initialize member with 'hardcoded' default values.
static FormulaFactors instance()
          Get the singleton FormulaFactors instance.
 void readFromXML(java.lang.String dateiname)
          Read an XML file with star formula configurations.
 FactorObject readObject(java.lang.String tagname, org.w3c.dom.Element root)
          Read the single skill contributions for a position.
static void resetLastChange()
          Reset last change date to now
 void save()
          gesaved
 void setPositionFactor(byte pos, FactorObject factorObject)
          set factorObject for a hoPosition
 void write2XML(java.lang.String filename)
          Write the currently configured values into a specified file.
protected  void writeFaktorObj(org.w3c.dom.Document doc, FactorObject obj, org.w3c.dom.Element root, java.lang.String tagName)
          Add data for a single position to the XML tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_clInstance

protected static FormulaFactors m_clInstance
singelton


ANZ_FAKTOROBJEKTE

protected static final int ANZ_FAKTOROBJEKTE
Konstante wieviel PositionsObjekte es gibt

See Also:
Constant Field Values
Method Detail

instance

public static FormulaFactors instance()
Get the singleton FormulaFactors instance.


getAllObj

public FactorObject[] getAllObj()
liefert Array mit allen Objekten


importDefaults

public void importDefaults()
Import star formulas from the default XML.


init

public void init()
Initialize member with 'hardcoded' default values. Usually these values should never be used, as we read the default.xml afterwards.


readFromXML

public void readFromXML(java.lang.String dateiname)
Read an XML file with star formula configurations.

Parameters:
dateiname - the filename of the xml config

readObject

public FactorObject readObject(java.lang.String tagname,
                               org.w3c.dom.Element root)
Read the single skill contributions for a position.

Parameters:
tagname - tag name for a position
root - the XML root element
Returns:
the created FactorObject

save

public void save()
gesaved


write2XML

public void write2XML(java.lang.String filename)
Write the currently configured values into a specified file.


writeFaktorObj

protected void writeFaktorObj(org.w3c.dom.Document doc,
                              FactorObject obj,
                              org.w3c.dom.Element root,
                              java.lang.String tagName)
Add data for a single position to the XML tree.


getPositionFactor

public FactorObject getPositionFactor(byte playerPosition)
Return a FactorObject for hoPosition

Parameters:
playerPosition -
Returns:

setPositionFactor

public void setPositionFactor(byte pos,
                              FactorObject factorObject)
set factorObject for a hoPosition

Parameters:
hoPosition -
factorObject -

getLastChange

public static java.util.Date getLastChange()
Get last change date

Returns:
last change date

resetLastChange

public static void resetLastChange()
Reset last change date to now