ar.com.ktulu.dict
Class Database

java.lang.Object
  |
  +--ar.com.ktulu.dict.Database
Direct Known Subclasses:
CompressedDatabase, FileDatabase, JDBCDatabase, VirtualDatabase

public abstract class Database
extends java.lang.Object

Base class for any kind of database no matter where the data are stored in.

Author:
Luis Parravicini

Constructor Summary
Database(java.lang.String name)
           
Database(java.lang.String name, java.lang.String shortinfo, java.lang.String info)
           
 
Method Summary
abstract  Matches define(java.lang.String word)
          Used by the server to process a "DEFINE" command.
 java.lang.String getInfo()
           
 java.lang.String getName()
           
protected  java.lang.String getProperty(java.lang.String name)
          Like getProperty(name, null).
protected  java.lang.String getProperty(java.lang.String name, java.lang.String def)
          If name begins with '@' it does a word lookup of that word and returns that, or else it returns name; and if name is null, it returns def.
 java.lang.String getShortInfo()
           
abstract  Definition getWordDefinition(Key k)
          Returns the definition of the word stored in k.
abstract  int keySize()
          Returns the number of headwords in the database.
abstract  Matches match(java.lang.String word, Strategy strat)
          Used by the server to process a "MATCH" command.
 void setInfo(java.lang.String info)
           
 void setName(java.lang.String name)
           
 void setShortInfo(java.lang.String def)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Database

public Database(java.lang.String name,
                java.lang.String shortinfo,
                java.lang.String info)

Database

public Database(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
                         throws DatabaseException
DatabaseException

setName

public void setName(java.lang.String name)

getShortInfo

public java.lang.String getShortInfo()
                              throws DatabaseException
DatabaseException

setShortInfo

public void setShortInfo(java.lang.String def)

getInfo

public java.lang.String getInfo()
                         throws DatabaseException
DatabaseException

setInfo

public void setInfo(java.lang.String info)

getProperty

protected java.lang.String getProperty(java.lang.String name)
                                throws DatabaseException
Like getProperty(name, null).

DatabaseException
See Also:
getProperty(String, String)

getProperty

protected java.lang.String getProperty(java.lang.String name,
                                       java.lang.String def)
                                throws DatabaseException
If name begins with '@' it does a word lookup of that word and returns that, or else it returns name; and if name is null, it returns def.

DatabaseException

keySize

public abstract int keySize()
                     throws DatabaseException
Returns the number of headwords in the database.

DatabaseException

define

public abstract Matches define(java.lang.String word)
                        throws DatabaseException
Used by the server to process a "DEFINE" command.

DatabaseException

getWordDefinition

public abstract Definition getWordDefinition(Key k)
                                      throws DatabaseException
Returns the definition of the word stored in k.

DatabaseException

match

public abstract Matches match(java.lang.String word,
                              Strategy strat)
                       throws DatabaseException
Used by the server to process a "MATCH" command.

DatabaseException