net.ajaest.data.kanji
Class KanjiTag

java.lang.Object
  extended by net.ajaest.data.kanji.KanjiTag
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<KanjiTag>
Direct Known Subclasses:
Kanji

public class KanjiTag
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<KanjiTag>

Inmutable class that stores some different informations about a kanji

Author:
Luis Alfonso Arce González
See Also:
Serialized Form

Field Summary
protected  java.lang.Integer classicRadical
           
protected  java.util.Set<DicReferencePair> dicReferences
           
protected  java.lang.Integer frequency
           
protected  java.lang.Integer grade
           
protected  KanjiGraph graph
           
protected  JISPair jisCode
           
protected  java.lang.Integer JLPTLevel
           
protected  java.util.Set<MeaningEntry> meanings
           
protected  java.lang.Integer nelsonRadical
           
protected  KanjiQueryCodes queryCodes
           
protected  java.util.Set<ReadingEntry> readings
           
private static long serialVersionUID
           
protected  java.lang.Integer strokeCount
           
protected  java.util.Set<java.lang.Integer> strokeMiscounts
           
protected  java.lang.Integer unicode
           
protected  java.util.Set<VariantPair> variants
           
 
Constructor Summary
protected KanjiTag()
           
 
Method Summary
 int compareTo(KanjiTag o)
          Compares this kanji and another kanji by their's unicode value
 boolean equals(java.lang.Object obj)
           
 java.lang.String FormattedDescriptionString()
          Returns a predefined formatted string with all the information about this Kanji
 java.lang.Integer getClassicRadical()
           
 java.util.Set<DicReferencePair> getDicReferences()
           
 java.lang.Integer getFrequency()
           
 java.lang.Integer getGrade()
           
 KanjiGraph getGraph()
           
 JISPair getJisCode()
          Returns the jis code information stored in a JISCode object where first() represents the codification (e.g "jis208") and second() represents the jis code (e.g "16-2").
 java.lang.Integer getJLPTLevel()
           
 java.util.Set<MeaningEntry> getMeanings()
           
 java.lang.Integer getNelsonRadical()
           
 KanjiQueryCodes getQueryCodes()
           
 java.util.Set<ReadingEntry> getReadings()
           
 java.lang.Integer getStrokeCount()
           
 java.util.Set<java.lang.Integer> getStrokeMiscounts()
           
 java.lang.Integer getUnicode()
           
 java.util.Set<VariantPair> getVariants()
           
 int hashCode()
           
static boolean isKanji(java.lang.Integer unicodeValue)
           
static java.lang.String kanaToRomaji(java.lang.String s)
          Converts the input kana string into romaji string.
static void main(java.lang.String... args)
           
 char[] toChar()
           
 KanjiTag toRomaji()
          Returns a copy of the current kanji in which all kana kanji in readings has been translated into romaji.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

unicode

protected java.lang.Integer unicode

jisCode

protected JISPair jisCode

classicRadical

protected java.lang.Integer classicRadical

nelsonRadical

protected java.lang.Integer nelsonRadical

grade

protected java.lang.Integer grade

strokeCount

protected java.lang.Integer strokeCount

strokeMiscounts

protected java.util.Set<java.lang.Integer> strokeMiscounts

variants

protected java.util.Set<VariantPair> variants

frequency

protected java.lang.Integer frequency

JLPTLevel

protected java.lang.Integer JLPTLevel

dicReferences

protected java.util.Set<DicReferencePair> dicReferences

readings

protected java.util.Set<ReadingEntry> readings

meanings

protected java.util.Set<MeaningEntry> meanings

queryCodes

protected KanjiQueryCodes queryCodes

graph

protected KanjiGraph graph
Constructor Detail

KanjiTag

protected KanjiTag()
Method Detail

isKanji

public static final boolean isKanji(java.lang.Integer unicodeValue)

kanaToRomaji

public static final java.lang.String kanaToRomaji(java.lang.String s)
Converts the input kana string into romaji string. Any non kana string will be surrounded like "\". Okurigana marks('.') will be removed and suffix marks('-') will be kept.

Parameters:
s - kana string
Returns:
string with kana chars converted into romaji

compareTo

public int compareTo(KanjiTag o)
Compares this kanji and another kanji by their's unicode value

Specified by:
compareTo in interface java.lang.Comparable<KanjiTag>
Parameters:
o - Kanji object to be compared with
Returns:
this.getUnicodeValue().compareTo(anotherKanji.getUnicodeValue())

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

FormattedDescriptionString

public java.lang.String FormattedDescriptionString()
Returns a predefined formatted string with all the information about this Kanji

Returns:
String with all info about the kanji.

getClassicRadical

public java.lang.Integer getClassicRadical()

getDicReferences

public java.util.Set<DicReferencePair> getDicReferences()

getFrequency

public java.lang.Integer getFrequency()

getGrade

public java.lang.Integer getGrade()

getGraph

public KanjiGraph getGraph()

getJisCode

public JISPair getJisCode()
Returns the jis code information stored in a JISCode object where first() represents the codification (e.g "jis208") and second() represents the jis code (e.g "16-2").

Returns:
JISPair representing a JIS code.

getJLPTLevel

public java.lang.Integer getJLPTLevel()

getMeanings

public java.util.Set<MeaningEntry> getMeanings()

getNelsonRadical

public java.lang.Integer getNelsonRadical()

getQueryCodes

public KanjiQueryCodes getQueryCodes()

getReadings

public java.util.Set<ReadingEntry> getReadings()

getStrokeCount

public java.lang.Integer getStrokeCount()

getStrokeMiscounts

public java.util.Set<java.lang.Integer> getStrokeMiscounts()

getUnicode

public java.lang.Integer getUnicode()

getVariants

public java.util.Set<VariantPair> getVariants()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toChar

public char[] toChar()

toRomaji

public final KanjiTag toRomaji()
Returns a copy of the current kanji in which all kana kanji in readings has been translated into romaji.

Returns:
a copy of the current kanji with romanized text

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String... args)
                 throws java.io.IOException
Throws:
java.io.IOException