net.ajaest.data.dict
Class KanjiDict

java.lang.Object
  extended by net.ajaest.data.dict.KanjiDict

public class KanjiDict
extends java.lang.Object

Class that provides methods to query and retrieve information about kanjis.

Author:
Luis Alfonso Arce González

Field Summary
private  KanjiDatabaseManager kdm
           
private  java.util.Set<KanjiTag> previousSearch
           
 
Constructor Summary
KanjiDict(java.io.File f)
           
KanjiDict(java.lang.String path)
           
 
Method Summary
 void close()
           
 java.util.Set<KanjiTag> executeQuery(KanjiExpression ke)
          Returns a set of kanji from database that matches all the conditions defined in the specified kanji expression.
 java.util.Set<KanjiTag> executeQueryFromPrevious(KanjiExpression ke)
          Returns a set of kanji from the previous query that matches all the conditions defined in the specified kanji expression.
 KanjiDatabaseInfo getDatabaseInfo()
           
 KanjiTag getKanjiByUnicode(java.lang.Integer unicodeValue)
          Returns the kanji specified by it's unicode value.
 java.util.Set<KanjiTag> getPreviousSearch()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kdm

private KanjiDatabaseManager kdm

previousSearch

private java.util.Set<KanjiTag> previousSearch
Constructor Detail

KanjiDict

public KanjiDict(java.io.File f)
Parameters:
f - a File class representing a database file

KanjiDict

public KanjiDict(java.lang.String path)
Parameters:
path - the kanji database path
Method Detail

getKanjiByUnicode

public KanjiTag getKanjiByUnicode(java.lang.Integer unicodeValue)
Returns the kanji specified by it's unicode value.

Parameters:
unicodeValue - The unicode value of the queried kanji
Returns:
the kanji which unicode value is the specified in unicodeValue, or null if the unicode value does not represents a kanji or the kanji does not exists in the database

executeQuery

public java.util.Set<KanjiTag> executeQuery(KanjiExpression ke)
Returns a set of kanji from database that matches all the conditions defined in the specified kanji expression.

Parameters:
ke - a kanji expression defining a kanji or a group of kanjis
Returns:
a set of kanjis that matches all the conditions specified in {code ke} kanji expression

executeQueryFromPrevious

public java.util.Set<KanjiTag> executeQueryFromPrevious(KanjiExpression ke)
Returns a set of kanji from the previous query that matches all the conditions defined in the specified kanji expression. This method should be faster than executeQuery.

Parameters:
ke - a kanji expression defining a kanji or a group of kanjis
Returns:
a set of kanjis that matches all the conditions specified in {code ke} kanji expression

getPreviousSearch

public java.util.Set<KanjiTag> getPreviousSearch()
Returns:
the previous result of the last call to executeQuery or executeQueryFromPrevious methods, null if those methods has never been called in this object.

getDatabaseInfo

public KanjiDatabaseInfo getDatabaseInfo()

close

public void close()