blob: fb68169c33c5ef2755911d6ab0a2204c8291b419 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
package org.madore.android.unicodeMap;
import java.util.Formatter;
public class UnicodeCharacter {
protected final int codePoint;
protected final String name;
protected final String category;
public UnicodeCharacter(int codePoint, String name, String category) {
this.codePoint = codePoint;
this.name = name;
this.category = category;
}
public int getCodePoint() {
return codePoint;
}
public String getName() {
return name;
}
@Override
public String toString() {
StringBuilder s = new StringBuilder();
s.append(Character.toChars(codePoint));
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);
}
}
|