From b0124ceb30ebde2aa7ff42351d4160f5cb85d8c2 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Wed, 4 Sep 2013 22:30:06 +0200 Subject: Indicate character block (and not just category) in details. --- src/org/madore/android/unicodeMap/UnicodeCharacter.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/org/madore/android/unicodeMap/UnicodeCharacter.java') 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; } -- cgit v1.2.3