HangulReplacement Class Reference

Inheritance diagram for HangulReplacement:

InputReplacement ReplacementFactory List of all members.

Public Member Functions

synchronized String getReplacement (String input)
 Gives the temporary replacement for the prefix of input.

synchronized String replacesPrefixOf (String input)
 Searches a prefix of input which is replaced by this mapping.

synchronized String[] isContinuationOf (String input)
 Checks, if the there is a matching continuation of input.

String getInputInfo ()
 Returns a typical input for documentation purposes.

String getReplacementInfo ()
 Returns a typical replacement for documentation purposes.

 HangulReplacement (BufferedReader input) throws IOException, FileFormatException

Package Attributes

String prefix = null
String suffix = null
String placeHolder = "XXXX"
String replinfo = null
int caseHandling = CASE_UPPER
int choseong = 0
int jungseong = 0
int jongseong = 0

Static Package Attributes

final int CASE_UPPER = 1
final int CASE_LOWER = 2
final int CASE_IGNORE = 3

Private Member Functions

void parseInput (String input)

Private Attributes

String cache = null
int pfxLength
String continuation1
String continuation2

Constructor & Destructor Documentation

HangulReplacement BufferedReader  input  )  throws IOException, FileFormatException [inline]
 

Definition at line 495 of file HangulReplacement.java.

References CASE_IGNORE, caseHandling, placeHolder, prefix, replinfo, and suffix.


Member Function Documentation

String getInputInfo  )  [inline, virtual]
 

Returns a typical input for documentation purposes.

This methods yield a string representing a typical input of this InputReplacement. It may but does not need to be a prefix matched by replacesPrefixOf (i.e. replacesPrefixOf(getInputInfo()).equals(getInputInfo())).

Returns:
a prefix for replacesPrefixOf or any other string.
See also:
getReplacementInfo()

replacesPrefixOf(String)

Implements InputReplacement.

Definition at line 489 of file HangulReplacement.java.

References placeHolder, prefix, and suffix.

Referenced by parseInput().

synchronized String getReplacement String  input  )  [inline, virtual]
 

Gives the temporary replacement for the prefix of input.

This method yields a replacement for the prefix returned by replacesPrefixOf(input). This replacement is shown in the temporary output.

This method must not be called if replacesPrefixOf(input)==null.

Parameters:
input the input in which to replace.
Returns:
the replacement for the prefix
See also:
replacesPrefixOf(String)

Implements InputReplacement.

Definition at line 20 of file HangulReplacement.java.

References choseong, getReplacement(), jongseong, jungseong, and parseInput().

Referenced by getReplacement().

String getReplacementInfo  )  [inline]
 

Returns a typical replacement for documentation purposes.

This method returns the replacement counterpart of getInputInfo() (like getReplacementInfo(getInputInfo())).

The default behaviour of this method is to return getReplacement(getInputInfo()).

If getReplacement(getInputInfo())==null, then you must override this method in subclasses.

Returns:
a replacement of getInputInfo() or any other string.
See also:
getInputInfo()

getReplacement(String)

Reimplemented from InputReplacement.

Definition at line 492 of file HangulReplacement.java.

References replinfo.

synchronized String [] isContinuationOf String  input  )  [inline, virtual]
 

Checks, if the there is a matching continuation of input.

More formally, checks for the existence of a string cont, such that:

<blockquote>

 cont.startsWith(input) &&
 !cont.equals(input) &&
 replacesPrefixOf(input)!=null &&
 !replacesPrefixOf(input).equals(cont)

If this InputReplacement replaces only one single string str, than this is equivalent to checking whether input is a proper substring of input.

If there is a continuation, this methods returns an array of continuations to present the user. This may be the set of all strings cont matching the above condition (or the string str in the case of just a single mapping), but the array can take any other value representing intuitively the set of all continuations (e.g. a pattern). The array may also be empty, then the user will not be informed of possible continuations.

If there are no continuations, return null.

Parameters:
input the string to check for continuations.
Returns:
an array of continuations or null (see description).
See also:
replacesPrefixOf(String)

Implements InputReplacement.

Definition at line 482 of file HangulReplacement.java.

References continuation1, continuation2, and isContinuationOf().

Referenced by isContinuationOf().

void parseInput String  input  )  [inline, private]
 

Definition at line 34 of file HangulReplacement.java.

References cache, CASE_IGNORE, CASE_LOWER, caseHandling, choseong, continuation1, continuation2, getInputInfo(), jongseong, jungseong, parseInput(), pfxLength, placeHolder, prefix, and suffix.

Referenced by getReplacement(), parseInput(), and replacesPrefixOf().

synchronized String replacesPrefixOf String  input  )  [inline, virtual]
 

Searches a prefix of input which is replaced by this mapping.

If this mapping can replace more than one prefix of input, the longest is to be chosen.

Parameters:
input the input in which to search.
Returns:
the prefix of input, or null if there is none.

Implements InputReplacement.

Definition at line 29 of file HangulReplacement.java.

References parseInput(), pfxLength, and replacesPrefixOf().

Referenced by replacesPrefixOf().


Member Data Documentation

String cache = null [private]
 

Definition at line 13 of file HangulReplacement.java.

Referenced by parseInput().

final int CASE_IGNORE = 3 [static, package]
 

Definition at line 7 of file HangulReplacement.java.

Referenced by HangulReplacement(), and parseInput().

final int CASE_LOWER = 2 [static, package]
 

Definition at line 6 of file HangulReplacement.java.

Referenced by parseInput().

final int CASE_UPPER = 1 [static, package]
 

Definition at line 5 of file HangulReplacement.java.

int caseHandling = CASE_UPPER [package]
 

Definition at line 12 of file HangulReplacement.java.

Referenced by HangulReplacement(), and parseInput().

int choseong = 0 [package]
 

Definition at line 17 of file HangulReplacement.java.

Referenced by getReplacement(), and parseInput().

String continuation1 [private]
 

Definition at line 15 of file HangulReplacement.java.

Referenced by isContinuationOf(), and parseInput().

String continuation2 [private]
 

Definition at line 16 of file HangulReplacement.java.

Referenced by isContinuationOf(), and parseInput().

int jongseong = 0 [package]
 

Definition at line 19 of file HangulReplacement.java.

Referenced by getReplacement(), and parseInput().

int jungseong = 0 [package]
 

Definition at line 18 of file HangulReplacement.java.

Referenced by getReplacement(), and parseInput().

int pfxLength [private]
 

Definition at line 14 of file HangulReplacement.java.

Referenced by parseInput(), and replacesPrefixOf().

String placeHolder = "XXXX" [package]
 

Definition at line 10 of file HangulReplacement.java.

Referenced by getInputInfo(), HangulReplacement(), and parseInput().

String prefix = null [package]
 

Definition at line 8 of file HangulReplacement.java.

Referenced by getInputInfo(), HangulReplacement(), and parseInput().

String replinfo = null [package]
 

Definition at line 11 of file HangulReplacement.java.

Referenced by getReplacementInfo(), and HangulReplacement().

String suffix = null [package]
 

Definition at line 9 of file HangulReplacement.java.

Referenced by getInputInfo(), HangulReplacement(), and parseInput().


The documentation for this class was generated from the following file:
Generated on Sun Aug 15 11:56:54 2004 for International Input by doxygen 1.3.7