com.aranai.dungeonator.datastore
Class DungeonDataStore

java.lang.Object
  extended by com.aranai.dungeonator.datastore.DungeonDataStore
All Implemented Interfaces:
IDungeonDataStore

public class DungeonDataStore
extends java.lang.Object
implements IDungeonDataStore

Provides a default (non-functional) implementation for others to extend.


Constructor Summary
DungeonDataStore()
           
 
Method Summary
 void deleteChunk(DungeonChunk chunk)
          Delete chunk.
 DungeonChunk getChunk(java.lang.String hash)
          Gets a DungeonChunk from the data store.
 boolean saveChunk(DungeonChunk chunk)
          Saves a DungeonChunk to the data store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DungeonDataStore

public DungeonDataStore()
Method Detail

getChunk

public DungeonChunk getChunk(java.lang.String hash)
                      throws DataStoreGetException
Description copied from interface: IDungeonDataStore
Gets a DungeonChunk from the data store.

Specified by:
getChunk in interface IDungeonDataStore
Parameters:
hash - the hash for the chunk
Returns:
the DungeonChunk if the hash is valid, or null otherwise
Throws:
DataStoreGetException

saveChunk

public boolean saveChunk(DungeonChunk chunk)
                  throws DataStoreSaveException
Description copied from interface: IDungeonDataStore
Saves a DungeonChunk to the data store.

Specified by:
saveChunk in interface IDungeonDataStore
Parameters:
chunk - the DungeonChunk to save
Returns:
true, if successful
Throws:
DataStoreSaveException - if an error occurs while saving the chunk

deleteChunk

public void deleteChunk(DungeonChunk chunk)
                 throws DataStoreDeleteException
Description copied from interface: IDungeonDataStore
Delete chunk.

Specified by:
deleteChunk in interface IDungeonDataStore
Parameters:
chunk - the chunk
Throws:
DataStoreDeleteException - if an error occurs while deleting the chunk