package com.mcpekorea.calcium.hangul;

public class Hangul {
	public static enum Mode {
		OBJECT, NOUN, CONJUNCTION;
	}
	
	public static final char CHAR_BEGIN = 0xAC00; //-> 가
	public static final char CHAR_END = 0xD7A3;   //-> 힣
	
	public static final char CHAR_EUL = 51012;    //-> 을
	public static final char CHAR_LEUL = 47484;   //-> 를
	public static final char CHAR_I = 51060;      //-> 이
	public static final char CHAR_GA = 44032;     //-> 가
	public static final char CHAR_EUN = 51008;    //-> 은
	public static final char CHAR_NEUN = 45716;   //-> 는
	
	
	public static boolean hasFinalConsonant(final char unicode){
		if(unicode < CHAR_BEGIN || unicode > CHAR_END)
			throw new CharacterIndexOutOfBoundsException(unicode);
		
		return (unicode - CHAR_BEGIN) % 28 != 0;
	}
	
	public static char getNext(final char unicode, final Hangul.Mode mode){
		if(unicode < CHAR_BEGIN || unicode > CHAR_END)
			throw new CharacterIndexOutOfBoundsException(unicode);
		
		switch(mode){
			case OBJECT:
				return hasFinalConsonant(unicode) ? CHAR_EUL : CHAR_LEUL;
					
			case NOUN:
				return hasFinalConsonant(unicode) ? CHAR_EUN : CHAR_NEUN;
				
			case CONJUNCTION:
				return hasFinalConsonant(unicode) ? CHAR_I : CHAR_GA;
				
			default:
				throw new IllegalArgumentException();
		}
	}
}

@@ -168,16 +168,17 @@
  0xAC00;
+ 
  //-%3E %EA%B0%80%0D
@@ -221,24 +221,25 @@
 = 0xD7A3;   
+ 
 //-%3E %ED%9E%A3%0D%0A%09%0D%0A%09
@@ -278,13 +278,14 @@
 L = 
-51012
+0xC744
 ;   
@@ -335,13 +335,14 @@
 L = 
-47484
+0xB97C
 ;   
@@ -388,13 +388,14 @@
 I = 
-51060
+0xC774
 ;   
@@ -445,18 +445,19 @@
 A = 
-44032;    
+CHAR_BEGIN;
  //-
@@ -502,13 +502,14 @@
 N = 
-51008
+0xC740
 ;   
@@ -559,13 +559,14 @@
 N = 
-45716
+0xB294
 ;   

Edit const value