net.sourceforge.wohenchan.convert
Class DefaultConverterEntry

java.lang.Object
  |
  +--net.sourceforge.wohenchan.convert.DefaultConverterEntry
All Implemented Interfaces:
ConverterEntryInterface

public class DefaultConverterEntry
extends java.lang.Object
implements ConverterEntryInterface

This class is the store unit for each dictionary entry. This particular implementation is immutable, but other implementations do not necessarily need to be. This class is not very useful, given that there are two types of exceptions thrown by the getGB, getEng methods. This class is likely to go away, to be replaced with converter-specific entry classes. Either that, or the exceptions from the methods in ConverterEntryInterface will have to change.

Version:
$Name: $ $Date: 2003/06/22 18:10:48 $
Author:
$Author: wtanaka $

Field Summary
private  java.lang.String m_chinese
           
private  java.lang.String m_english
           
private  java.lang.String m_pinyin
           
private  java.lang.String m_source
           
 
Constructor Summary
DefaultConverterEntry(java.lang.String chinese, java.lang.String english, java.lang.String pinyin, java.lang.String source)
          Constructor.
 
Method Summary
 java.lang.String getChinese()
          Gets the unicode character string for this entry.
 java.lang.String getEnglishDefinition()
          Gets the English Definition for this character.
 java.lang.String getPinyin()
          Gets the Pinyin for this entry.
 java.lang.String getSource()
          Gets the source dictionary where this entry came from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_chinese

private java.lang.String m_chinese

m_english

private java.lang.String m_english

m_pinyin

private java.lang.String m_pinyin

m_source

private java.lang.String m_source
Constructor Detail

DefaultConverterEntry

public DefaultConverterEntry(java.lang.String chinese,
                             java.lang.String english,
                             java.lang.String pinyin,
                             java.lang.String source)
Constructor. Makes local copies of all input, so that mutable data referenced by this class is guaranteed not to be aliased anywhere else.

Parameters:
english - WHERE (english != null)
pinyin - WHERE (pinyin != null)
Method Detail

getEnglishDefinition

public java.lang.String getEnglishDefinition()
Description copied from interface: ConverterEntryInterface
Gets the English Definition for this character.

Specified by:
getEnglishDefinition in interface ConverterEntryInterface
Returns:
WHERE (self != null) the english definition for this entry.

getChinese

public java.lang.String getChinese()
Description copied from interface: ConverterEntryInterface
Gets the unicode character string for this entry.

Specified by:
getChinese in interface ConverterEntryInterface
Returns:
WHERE (self != null) the string (of unicode chars) for this entry.

getPinyin

public java.lang.String getPinyin()
Description copied from interface: ConverterEntryInterface
Gets the Pinyin for this entry. The input string is specified in pinyin. The string may be composed of the letters 'a'-'z' (lower case only), the numbers '1'-'5' and space (' '). The string is composed of at least 1 space-separated pinyin syllables. Syllables are separated with exactly one space. There is no leading or trailing space. Each syllable is composed of at least two letters followed by exactly one digit. The neutral tone is expicitly specified with '5'. u w/ umlaut (as in luu2 (donkey, palm tree), or luu3 (drizzle) is specified with uu.

Specified by:
getPinyin in interface ConverterEntryInterface
Returns:
WHERE (self != null) the pinyin romanization for this entry.

getSource

public java.lang.String getSource()
Description copied from interface: ConverterEntryInterface
Gets the source dictionary where this entry came from.

Specified by:
getSource in interface ConverterEntryInterface
Returns:
WHERE (self != null) a human visible name for this entry's source (e.g. "CEDICT", "unicode.org", "Sunrain").