From 507920843d9a09c67aafce560e94b29f91b94ee5 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 3 Apr 2002 22:03:23 +0000 Subject: [PATCH] Added method for checking to see if a tileset is mapped to an id. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1175 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/media/tile/TileSetIDBroker.java | 13 ++++++++++++- .../media/tile/tools/MapFileTileSetIDBroker.java | 9 ++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/media/tile/TileSetIDBroker.java b/src/java/com/threerings/media/tile/TileSetIDBroker.java index 7c7f409c8..3387dbdfe 100644 --- a/src/java/com/threerings/media/tile/TileSetIDBroker.java +++ b/src/java/com/threerings/media/tile/TileSetIDBroker.java @@ -1,5 +1,5 @@ // -// $Id: TileSetIDBroker.java,v 1.2 2001/11/21 02:42:15 mdb Exp $ +// $Id: TileSetIDBroker.java,v 1.3 2002/04/03 22:03:21 mdb Exp $ package com.threerings.media.tile; @@ -30,6 +30,17 @@ public interface TileSetIDBroker public int getTileSetID (String tileSetName) throws PersistenceException; + /** + * Returns true if the specified tileset name is currently mapped to + * some value by this broker. + * + * @exception PersistenceException 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; + /** * 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 diff --git a/src/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java b/src/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java index 7ba1f3e05..492d84dc5 100644 --- a/src/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java +++ b/src/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java @@ -1,5 +1,5 @@ // -// $Id: MapFileTileSetIDBroker.java,v 1.2 2002/02/05 20:29:09 mdb Exp $ +// $Id: MapFileTileSetIDBroker.java,v 1.3 2002/04/03 22:03:23 mdb Exp $ package com.threerings.media.tile.tools; @@ -64,6 +64,13 @@ public class MapFileTileSetIDBroker implements TileSetIDBroker return tsid.intValue(); } + // documentation inherited from interface + public boolean tileSetMapped (String tileSetName) + throws PersistenceException + { + return _map.containsKey(tileSetName); + } + // documentation inherited public void commit () throws PersistenceException