com.threerings.media.tile
Interface TileSetRepository

All Known Implementing Classes:
BundledTileSetRepository

public interface TileSetRepository

The tileset repository interface should be implemented by classes that provide access to tilesets keyed on a unique tileset identifier. The tileset id space is up to the repository implementation, which may or may not desire to use a TileSetIDBroker to manage the space.


Method Summary
 Iterator<Integer> enumerateTileSetIds()
          Returns an iterator over the identifiers of all TileSet objects available.
 Iterator<TileSet> enumerateTileSets()
          Returns an iterator over all TileSet objects available.
 TileSet getTileSet(int tileSetId)
          Returns the TileSet with the specified tile set identifier.
 TileSet getTileSet(String setName)
          Returns the TileSet with the specified tile set name.
 int getTileSetId(String setName)
          Returns the unique identifier of the TileSet with the specified tile set name.
 

Method Detail

enumerateTileSetIds

Iterator<Integer> enumerateTileSetIds()
                                      throws PersistenceException
Returns an iterator over the identifiers of all TileSet objects available.

Throws:
PersistenceException

enumerateTileSets

Iterator<TileSet> enumerateTileSets()
                                    throws PersistenceException
Returns an iterator over all TileSet objects available.

Throws:
PersistenceException

getTileSet

TileSet getTileSet(int tileSetId)
                   throws NoSuchTileSetException,
                          PersistenceException
Returns the TileSet with the specified tile set identifier. The repository is responsible for configuring the tile set with an image provider.

Throws:
NoSuchTileSetException - thrown if no tileset exists with the specified identifier.
PersistenceException - thrown if an error occurs communicating with the underlying persistence mechanism.

getTileSetId

int getTileSetId(String setName)
                 throws NoSuchTileSetException,
                        PersistenceException
Returns the unique identifier of the TileSet with the specified tile set name.

Throws:
NoSuchTileSetException - thrown if no tileset exists with the specified name.
PersistenceException - thrown if an error occurs communicating with the underlying persistence mechanism.

getTileSet

TileSet getTileSet(String setName)
                   throws NoSuchTileSetException,
                          PersistenceException
Returns the TileSet with the specified tile set name. The repository is responsible for configuring the tile set with an image provider.

Throws:
NoSuchTileSetException - thrown if no tileset exists with the specified name.
PersistenceException - thrown if an error occurs communicating with the underlying persistence mechanism.