summaryrefslogtreecommitdiffstats
path: root/src/org/madore/android/unicodeMap/UnicodeCharacter.java
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2010-05-01 23:14:07 +0200
committerDavid A. Madore <david+git@madore.org>2010-05-01 23:14:07 +0200
commit1c6eb70f0640269304041982f7514df92b047776 (patch)
tree8e6206a5a0d1a90b45c1c24151012f9718eb5c48 /src/org/madore/android/unicodeMap/UnicodeCharacter.java
parentd19282f8ce9d4256875e37358eda3ee19527d1f6 (diff)
downloadUnicodeMap-1c6eb70f0640269304041982f7514df92b047776.tar.gz
UnicodeMap-1c6eb70f0640269304041982f7514df92b047776.tar.bz2
UnicodeMap-1c6eb70f0640269304041982f7514df92b047776.zip
New feature: decode Unicode character string.
Diffstat (limited to 'src/org/madore/android/unicodeMap/UnicodeCharacter.java')
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeCharacter.java21
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