megamek.common
Class EntityListFile

java.lang.Object
  extended by megamek.common.EntityListFile

public class EntityListFile
extends java.lang.Object

This class provides static methods to save a list of Entitys to, and load a list of Entitys from a file.


Constructor Summary
EntityListFile()
           
 
Method Summary
static java.util.Vector<Entity> loadFrom(java.io.File file)
          Load a list of Entitys from the given file.
static void saveTo(java.io.File file, java.util.ArrayList<Entity> list)
          Save the Entitys in the list to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityListFile

public EntityListFile()
Method Detail

saveTo

public static void saveTo(java.io.File file,
                          java.util.ArrayList<Entity> list)
                   throws java.io.IOException
Save the Entitys in the list to the given file.

The Entitys\" pilots, damage, ammo loads, ammo usage, and other campaign-related information are retained but data specific to a particular game is ignored.

Parameters:
file - - The current contents of the file will be discarded and all Entitys in the list will be written to the file.
list - - a Vector containing Entitys to be stored in a file.
Throws:
java.io.IOException - is thrown on any error.

loadFrom

public static java.util.Vector<Entity> loadFrom(java.io.File file)
                                         throws java.io.IOException
Load a list of Entitys from the given file.

The Entitys\" pilots, damage, ammo loads, ammo usage, and other campaign-related information are retained but data specific to a particular game is ignored.

Parameters:
file - - the File to load from.
Returns:
A Vector containing Entitys loaded from the file. This vector may be empty, but it will not be null.
Throws:
java.io.IOException - is thrown on any error.