Committing the work on converting the original work from Haxe to Java. RZ

Signed-off-by: regentzu <regent.zu@gmail.com>