net.sf.dict4j.cache
Class DictSessionWithCache

java.lang.Object
  extended by net.sf.dict4j.DictSession
      extended by net.sf.dict4j.cache.DictSessionWithCache

public class DictSessionWithCache
extends DictSession


Constructor Summary
DictSessionWithCache(DictTransport transport, CacheProvider cacheProvider)
           
DictSessionWithCache(java.lang.String address, CacheProvider cacheProvider)
           
DictSessionWithCache(java.lang.String address, int port, CacheProvider cacheProvider)
           
 
Method Summary
 java.lang.String databaseInfo(java.lang.String database)
           
 java.util.List<Definition> define(java.lang.String word, java.lang.String database)
          Get definitions of word from given database
 java.lang.String help()
           
 java.util.List<DatabaseWord> match(java.lang.String word, java.lang.String database, java.lang.String strategy)
          Match word in given database using given strategy
 java.lang.String serverInfo()
           
static void setCacheEnabled(boolean cacheEnabled)
           
 java.util.List<Database> showDatabases()
           
 java.util.List<Strategy> showStrategies()
           
 
Methods inherited from class net.sf.dict4j.DictSession
auth, client, close, define, define, define, getBanner, isClosed, isOpen, isOptionMime, match, match, match, open, quit, setLogAppender, setOptionMime, status
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictSessionWithCache

public DictSessionWithCache(java.lang.String address,
                            CacheProvider cacheProvider)

DictSessionWithCache

public DictSessionWithCache(java.lang.String address,
                            int port,
                            CacheProvider cacheProvider)

DictSessionWithCache

public DictSessionWithCache(DictTransport transport,
                            CacheProvider cacheProvider)
Method Detail

setCacheEnabled

public static void setCacheEnabled(boolean cacheEnabled)

help

public java.lang.String help()
Overrides:
help in class DictSession

serverInfo

public java.lang.String serverInfo()
Overrides:
serverInfo in class DictSession

databaseInfo

public java.lang.String databaseInfo(java.lang.String database)
Overrides:
databaseInfo in class DictSession

showDatabases

public java.util.List<Database> showDatabases()
Overrides:
showDatabases in class DictSession

showStrategies

public java.util.List<Strategy> showStrategies()
Overrides:
showStrategies in class DictSession

define

public java.util.List<Definition> define(java.lang.String word,
                                         java.lang.String database)
Get definitions of word from given database

Overrides:
define in class DictSession
Parameters:
word - word to match
database - database to search
Returns:
list of all available word's definitions

match

public java.util.List<DatabaseWord> match(java.lang.String word,
                                          java.lang.String database,
                                          java.lang.String strategy)
Match word in given database using given strategy

Overrides:
match in class DictSession
Parameters:
word - word to match
database - database to search matches
strategy - strategy to use for search
Returns:
List of database words matched