summaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeCharacter.java32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/org/madore/android/unicodeMap/UnicodeCharacter.java b/src/org/madore/android/unicodeMap/UnicodeCharacter.java
index 8fb64f7..34bab47 100644
--- a/src/org/madore/android/unicodeMap/UnicodeCharacter.java
+++ b/src/org/madore/android/unicodeMap/UnicodeCharacter.java
@@ -270,33 +270,45 @@ public class UnicodeCharacter implements UnicodeDisplayable {
protected final int codePoint;
protected final String name;
protected final Category category;
+ protected final String charStr;
+ protected final String label;
+
+ protected String makeCharStr() {
+ return new String(Character.toChars(codePoint));
+ }
+
+ protected String makeLabel() {
+ StringBuilder s = new StringBuilder();
+ 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);
+ }
public UnicodeCharacter(int codePoint, String name, Category category) {
this.codePoint = codePoint;
this.name = name;
this.category = category;
+ this.charStr = makeCharStr();
+ this.label = makeLabel();
}
public int getCodePoint() {
- return codePoint;
+ return this.codePoint;
}
public String getName() {
- return name;
+ return this.name;
}
public String getChar() {
- return new String(Character.toChars(codePoint));
+ return this.charStr;
}
public String getLabel() {
- StringBuilder s = new StringBuilder();
- 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);
+ return this.label;
}
public boolean isPrintable() {