/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package kanjiflash;

import java.util.ArrayList;

/**
 *
 * @author Alan
 */
public class Kanji {
    public int unicode;
    public String JISChar;
    public int gradeLevel;
//    public ArrayList<OnYomi> onVal;
//    public ArrayList<KunYomi> kunVal;
    public ArrayList<String> onVal;
    public ArrayList<String> kunVal;
    public ArrayList<String> englishDef;
    public Kanji(){
//        onVal= new ArrayList<OnYomi>();
//        kunVal = new ArrayList<KunYomi>();
        onVal = new ArrayList<String>();
        kunVal = new ArrayList<String>();
        englishDef = new ArrayList<String>();
        JISChar = "";
    }
    public Kanji(int uni){
        unicode = uni;
        onVal = new ArrayList<String>();
        kunVal = new ArrayList<String>();
        englishDef = new ArrayList<String>();
        JISChar = "";
    } 
    public Kanji(int uni, String JIS, int gradeLev){
        unicode = uni;
        gradeLevel = gradeLev;
        onVal = new ArrayList<String>();
        kunVal = new ArrayList<String>();
        englishDef = new ArrayList<String>(); 
        JISChar = JIS;
    }
    public String toString(){
        StringBuilder sb = new StringBuilder();
        int[] uniC = {unicode};
        sb.append("Unicode: ");
        sb.append(String.format("%x ", unicode));
        sb.append(new String(uniC, 0, 1));
        sb.append(" --JISChar = "+JISChar);
        sb.append(" Grade Level= "+gradeLevel+"\n");
        sb.append("ON readings: \n");
        for (String str : onVal){
            sb.append(str);
            sb.append("\n");
        }
        sb.append("KUN readings: \n");
        for (String str : kunVal){
            sb.append(str);
            sb.append("\n");
        }
        sb.append("English definitions: \n");
        for (String str : englishDef){
            sb.append(str);
            sb.append("\n");
        }        
        return sb.toString();
    }

}
