|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.media.tile.tools.MapFileTileSetIDBroker
public class MapFileTileSetIDBroker
Stores a set of tileset name to id mappings in a map file.
| Constructor Summary | |
|---|---|
MapFileTileSetIDBroker(File mapfile)
Creates a broker that will use the specified file as its persistent store. |
|
| Method Summary | |
|---|---|
void |
commit()
When the user of a tilset id broker is done obtaining tileset ids, it must call this method to give the tileset id broker an opportunity to flush any newly created tileset ids back to its persistent store. |
int |
getTileSetID(String tileSetName)
Returns the unique identifier for the named tileset. |
static void |
readMapFile(BufferedReader bin,
HashMap<String,Integer> map)
Reads in a mapping from strings to integers, which should have been written via writeMapFile(java.io.BufferedWriter, java.util.HashMap. |
boolean |
tileSetMapped(String tileSetName)
Returns true if the specified tileset name is currently mapped to some value by this broker. |
static void |
writeMapFile(BufferedWriter bout,
HashMap<String,Integer> map)
Writes out a mapping from strings to integers in a manner that can be read back in via readMapFile(java.io.BufferedReader, java.util.HashMap. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapFileTileSetIDBroker(File mapfile)
throws PersistenceException
PersistenceException| Method Detail |
|---|
public int getTileSetID(String tileSetName)
throws PersistenceException
TileSetIDBroker
getTileSetID in interface TileSetIDBrokerPersistenceException - thrown if an error occurs
communicating with the underlying persistence mechanism used to
store the name to id mappings.
public boolean tileSetMapped(String tileSetName)
throws PersistenceException
TileSetIDBroker
tileSetMapped in interface TileSetIDBrokerPersistenceException - thrown if an error occurs
communicating with the underlying persistence mechanism used to
store the name to id mappings.
public void commit()
throws PersistenceException
TileSetIDBroker
commit in interface TileSetIDBrokerPersistenceException
public static void readMapFile(BufferedReader bin,
HashMap<String,Integer> map)
throws IOException
writeMapFile(java.io.BufferedWriter, java.util.HashMap) .
IOException
public static void writeMapFile(BufferedWriter bout,
HashMap<String,Integer> map)
throws IOException
readMapFile(java.io.BufferedReader, java.util.HashMap) .
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||