org.erowid.sperowider.hsqldb
Class MapTable

java.lang.Object
  extended byorg.erowid.sperowider.hsqldb.BasicTable
      extended byorg.erowid.sperowider.hsqldb.MapTable

public class MapTable
extends BasicTable

This class presents some Map-like functionality wrapped around an HSQLDB table.

Version:
: $Header: /cvsroot/sperowider/SPEROWIDER_MODULE/javasource/org/erowid/sperowider/hsqldb/MapTable.java,v 1.6 2005/05/16 01:20:33 gurustu Exp $
Author:
: $Author: gurustu $

Field Summary
 
Fields inherited from class org.erowid.sperowider.hsqldb.BasicTable
CACHED, MEMORY
 
Constructor Summary
MapTable(String name, Connection connection, int mode)
          Constructor, gets everything ready for usage.
 
Method Summary
 void add(String fromValue, String toValue)
          Adds a mapping from one value to another value to this map.
 boolean contains(String fromValue)
          Returns true if the map contains this key.
 void create()
          Creates a new table in the backing database corresponding to this object.
 String map(String fromValue)
          Returns the value mapped to this key.
 void remove(String fromValue)
          Removes the mapping corresponding to this key.
 
Methods inherited from class org.erowid.sperowider.hsqldb.BasicTable
execSQL, getConnection, getMode, getName, getTableCreatePrefix, prepareStatement, tableExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapTable

public MapTable(String name,
                Connection connection,
                int mode)
         throws SQLException
Constructor, gets everything ready for usage.

Method Detail

create

public void create()
            throws SQLException
Creates a new table in the backing database corresponding to this object.

Throws:
SQLException

contains

public boolean contains(String fromValue)
Returns true if the map contains this key.


add

public void add(String fromValue,
                String toValue)
Adds a mapping from one value to another value to this map.


remove

public void remove(String fromValue)
Removes the mapping corresponding to this key.


map

public String map(String fromValue)
Returns the value mapped to this key.


spero logo small Sperowider is
© 2005 Erowid.org