summaryrefslogtreecommitdiffstats
path: root/src/org/madore/android/unicodeMap/UnicodeCharacter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/madore/android/unicodeMap/UnicodeCharacter.java')
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeCharacter.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/org/madore/android/unicodeMap/UnicodeCharacter.java b/src/org/madore/android/unicodeMap/UnicodeCharacter.java
index 0228644..89c83be 100644
--- a/src/org/madore/android/unicodeMap/UnicodeCharacter.java
+++ b/src/org/madore/android/unicodeMap/UnicodeCharacter.java
@@ -233,7 +233,8 @@ public class UnicodeCharacter implements UnicodeDisplayable {
TAGS(0xE0000, 0xE007F, "Tags"),
VARIATION_SELECTORS_SUPPLEMENT(0xE0100, 0xE01EF, "Variation Selectors Supplement"),
SUPPLEMENTARY_PRIVATE_USE_AREA_A(0xF0000, 0xFFFFF, "Supplementary Private Use Area-A"),
- SUPPLEMENTARY_PRIVATE_USE_AREA_B(0x100000, 0x10FFFF, "Supplementary Private Use Area-B");
+ SUPPLEMENTARY_PRIVATE_USE_AREA_B(0x100000, 0x10FFFF, "Supplementary Private Use Area-B"),
+ UNASSIGNED(0x110000, 0x110000, "Not Assigned");
protected final int from; protected final int to;
protected final String descr;
Range(int from, int last, String descr) {
@@ -422,6 +423,7 @@ public class UnicodeCharacter implements UnicodeDisplayable {
protected final int codePoint;
protected final String name;
+ protected Range range;
protected final Category category;
protected final boolean isUnicode;
protected final String charStr;
@@ -441,6 +443,7 @@ public class UnicodeCharacter implements UnicodeDisplayable {
public UnicodeCharacter(int codePoint, String name, Category category) {
this.codePoint = codePoint;
this.name = name;
+ this.range = null;
this.category = category;
this.isUnicode = true;
this.charStr = makeCharStr();
@@ -451,6 +454,7 @@ public class UnicodeCharacter implements UnicodeDisplayable {
boolean isUnicode) {
this.codePoint = codePoint;
this.name = name;
+ this.range = null;
this.category = category;
this.isUnicode = isUnicode;
this.charStr = makeCharStr();
@@ -465,6 +469,15 @@ public class UnicodeCharacter implements UnicodeDisplayable {
return this.name;
}
+ public Range getRange() {
+ if ( this.range != null )
+ return this.range;
+ for ( Range r : Range.values() )
+ if ( this.codePoint >= r.from && this.codePoint < r.to )
+ return this.range = r;
+ return this.range = Range.UNASSIGNED;
+ }
+
public Category getCategory() {
return this.category;
}