com.pegacat.vcf.data
Class Loader
java.lang.Object
|
+--com.pegacat.vcf.data.Loader
- Direct Known Subclasses:
- OfflineLoader, WebLoader
- public abstract class Loader
- extends java.lang.Object
A Loader initialises the data
variables of a DataLayer object.
Field Summary |
static boolean |
debug
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
debug
public static boolean debug
Loader
public Loader()
loadAll
public void loadAll(DataLayer data,
Loader.Watcher dataWatcher)
- This method is used to load all available data into the
DataLayer object. Since this may take some time, their
is facility to enable a 'Loader Watcher' which can
report back (usually via gui) to the user to show them
how the operation is progressing.
- Parameters:
data
- the DataLayer object to be initialisedwatcher
- the Loader.Watcher interface object to
report back on progress - may be null.
loadFinished
public void loadFinished(DataLayer data)
- This method can be extended to run any extra processing required when
a 'loadAll()' method has completed successfully.
saveAll
public void saveAll(DataLayer data)
- This method can be extended by loaders that can also save data, such as
the OfflineLoader which handles cached data...
setWatcher
protected void setWatcher(Loader.Watcher watcher,
int stage)
throws java.lang.Exception
getReport
public VoyagerText getReport()
getSummary
public VoyagerText getSummary()
getPopSurveys
public VoyagerText getPopSurveys()
getCargoReport
public VoyagerText getCargoReport()
getAllSurveys
public VoyagerText getAllSurveys()
getNewSurveys
public VoyagerText getNewSurveys()
getAllTech
public VoyagerText getAllTech()
getNewTech
public VoyagerText getNewTech()
getRaceDesc
public VoyagerText getRaceDesc()
getRawStars
public VoyagerText getRawStars()
getObjectTree
public VoyagerText getObjectTree()
getCurrentTurnNo
public java.lang.String getCurrentTurnNo()
- Tries to work out what the current turn is,
(currently, by loading up the cargo report and
parsing the header - better methods greatfully
accepted!).
getFile
public abstract VoyagerText getFile(java.lang.String fileName)
- This method is inherited by WebLoader and OfflineLoader
(and conceivably other loaders) to provide
their own way of getting the text file data...
getStars
public abstract Star[] getStars()
- This method is inherited by WebLoader and OfflineLoader
to get and parse the star list.
getStars
protected Star[] getStars(java.lang.String starData)
throws java.lang.Exception
- This parses the original star data file ('slocs.0'),
that is still available on the web page...
nextInt
protected int nextInt(java.util.StringTokenizer st)