diff options
Diffstat (limited to 'src/org/madore/android/unicodeMap/UnicodeCharacter.java')
-rw-r--r-- | src/org/madore/android/unicodeMap/UnicodeCharacter.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/org/madore/android/unicodeMap/UnicodeCharacter.java b/src/org/madore/android/unicodeMap/UnicodeCharacter.java index 42e449a..5d53ccb 100644 --- a/src/org/madore/android/unicodeMap/UnicodeCharacter.java +++ b/src/org/madore/android/unicodeMap/UnicodeCharacter.java @@ -222,6 +222,9 @@ public class UnicodeCharacter implements UnicodeDisplayable { public int getTo() { return this.to; } public String getDescr() { return this.descr; } public String getTitle() { return this.descr; } + public boolean belongs(int codePoint) { + return ( codePoint>=this.from && codePoint<this.to ); + } @Override public String toString() { return this.descr; } } @@ -389,6 +392,7 @@ public class UnicodeCharacter implements UnicodeDisplayable { protected final int codePoint; protected final String name; protected final Category category; + protected final boolean isUnicode; protected final String charStr; protected final String label; @@ -407,6 +411,17 @@ public class UnicodeCharacter implements UnicodeDisplayable { this.codePoint = codePoint; this.name = name; this.category = category; + this.isUnicode = true; + this.charStr = makeCharStr(); + this.label = makeLabel(); + } + + public UnicodeCharacter(int codePoint, String name, Category category, + boolean isUnicode) { + this.codePoint = codePoint; + this.name = name; + this.category = category; + this.isUnicode = isUnicode; this.charStr = makeCharStr(); this.label = makeLabel(); } @@ -431,8 +446,12 @@ public class UnicodeCharacter implements UnicodeDisplayable { return this.label; } + public boolean isUnicode() { + return this.isUnicode; + } + public boolean isPrintable() { - return printable.contains(this.category); + return this.isUnicode && printable.contains(this.category); } @Override |