package org.madore.android.unicodeMap; import java.util.Formatter; public class UnicodeCharacter { protected final int codePoint; protected final String name; protected final String category; public UnicodeCharacter(int codePoint, String name, String category) { this.codePoint = codePoint; this.name = name; this.category = category; } public int getCodePoint() { return codePoint; } public String getName() { return name; } @Override public String toString() { StringBuilder s = new StringBuilder(); s.append(Character.toChars(codePoint)); Formatter fmt = new Formatter(s); if ( codePoint < 0x10000 ) fmt.format(" (U+%04X %s)", codePoint, name); else fmt.format(" (U+%X %s)", codePoint, name); return new String(s); } }