shoddybattle
Class PokemonSpeciesData

java.lang.Object
  extended by shoddybattle.PokemonSpeciesData

public class PokemonSpeciesData
extends java.lang.Object


Constructor Summary
PokemonSpeciesData()
           
 
Method Summary
 void cacheMoveSets(MoveList moveList, MoveSetData moveSet, boolean requireImplementation)
          Cache the move sets of all of the pokemon.
 boolean canLearn(int i, java.lang.String move)
          Return whether this species can learn a particular move.
 boolean canUseAbility(java.lang.String name, java.lang.String ability)
          Return whether a pokemon can have a particular ability.
 java.lang.String[] getAbilityNames(java.lang.String name)
          Return an array of the names of the possible abilities a given pokemon can have.
 long getLastModified()
          Get the date when the database was last modified.
 java.util.TreeSet getLearnableMoves(int i)
          Return a TreeSet of moves that the pokemon can learn.
 int getPokemonByName(java.lang.String name)
          Find a pokemon by name.
 java.util.SortedSet getPossibleAbilities(java.lang.String name)
          Return a TreeSet of possible abilities.
 PokemonSpecies[] getSpecies()
          Get the species database.
 PokemonSpecies getSpecies(int i)
          Get a single species.
 int getSpeciesCount()
          Return the number of species.
 java.lang.String[] getSpeciesNames()
          Get the whole list of species names.
 boolean isAbilityImplemented(java.lang.String ability)
          Return whether an ability is implemented.
 void loadSpeciesDatabase(java.io.File file)
          Load a database of pokemon species in from a file, and require that abilities have been implemented.
 void loadSpeciesDatabase(java.io.File file, boolean requireImplementation)
          Load a database of pokemon species in from a file.
 void loadSpeciesDatabase(java.io.InputStream input, boolean requireImplementation)
          Load a database of pokemon species in from an input stream.
 void saveSpeciesDatabase(java.io.File f)
          Save a database of pokemon species to a file.
 void saveSpeciesDatabase(java.io.OutputStream out, boolean requireImplementation)
          Save a database of pokemon speices to an arbitrary file.
 void setAbilities(java.lang.String name, java.lang.String[] abilities, boolean impl)
          Add a pokemon's abilities to the HashMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PokemonSpeciesData

public PokemonSpeciesData()
Method Detail

getLastModified

public long getLastModified()
Get the date when the database was last modified.


saveSpeciesDatabase

public void saveSpeciesDatabase(java.io.File f)
                         throws java.io.IOException
Save a database of pokemon species to a file.

Throws:
java.io.IOException

saveSpeciesDatabase

public void saveSpeciesDatabase(java.io.OutputStream out,
                                boolean requireImplementation)
                         throws java.io.IOException
Save a database of pokemon speices to an arbitrary file.

Throws:
java.io.IOException

loadSpeciesDatabase

public void loadSpeciesDatabase(java.io.File file)
                         throws java.io.IOException,
                                java.io.FileNotFoundException
Load a database of pokemon species in from a file, and require that abilities have been implemented.

Throws:
java.io.IOException
java.io.FileNotFoundException

loadSpeciesDatabase

public void loadSpeciesDatabase(java.io.File file,
                                boolean requireImplementation)
                         throws java.io.IOException,
                                java.io.FileNotFoundException
Load a database of pokemon species in from a file.

Throws:
java.io.IOException
java.io.FileNotFoundException

loadSpeciesDatabase

public void loadSpeciesDatabase(java.io.InputStream input,
                                boolean requireImplementation)
                         throws java.io.IOException
Load a database of pokemon species in from an input stream.

Throws:
java.io.IOException

cacheMoveSets

public void cacheMoveSets(MoveList moveList,
                          MoveSetData moveSet,
                          boolean requireImplementation)
Cache the move sets of all of the pokemon.


setAbilities

public void setAbilities(java.lang.String name,
                         java.lang.String[] abilities,
                         boolean impl)
Add a pokemon's abilities to the HashMap.


isAbilityImplemented

public boolean isAbilityImplemented(java.lang.String ability)
Return whether an ability is implemented.


canUseAbility

public boolean canUseAbility(java.lang.String name,
                             java.lang.String ability)
Return whether a pokemon can have a particular ability.


getAbilityNames

public java.lang.String[] getAbilityNames(java.lang.String name)
Return an array of the names of the possible abilities a given pokemon can have. Note that this will return unimplemented abilities as well as implemented ones.


getPossibleAbilities

public java.util.SortedSet getPossibleAbilities(java.lang.String name)
Return a TreeSet of possible abilities. This only includes abilities that are actually implemented.


getSpecies

public PokemonSpecies[] getSpecies()
Get the species database.


getSpecies

public PokemonSpecies getSpecies(int i)
                          throws PokemonException
Get a single species.

Throws:
PokemonException

getSpeciesNames

public java.lang.String[] getSpeciesNames()
Get the whole list of species names. Note: this call is *expensive*.


getSpeciesCount

public int getSpeciesCount()
Return the number of species.


getPokemonByName

public int getPokemonByName(java.lang.String name)
Find a pokemon by name.


getLearnableMoves

public java.util.TreeSet getLearnableMoves(int i)
Return a TreeSet of moves that the pokemon can learn.


canLearn

public boolean canLearn(int i,
                        java.lang.String move)
Return whether this species can learn a particular move.