|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.HNSOctetUCSMap
public class HNSOctetUCSMap
Defines mappings in both directions between HNS 8-bit character code values (octets) and HamNoSys-UCS characters, most of which are in the UCS private use area. There are factory methods providing access to singleton instances, one which maps all UCS character values, and one which leaves UCS values below 256 unchanged.
| Field Summary | |
|---|---|
protected static java.lang.String |
HNS_OCTET_UCS_PROPS_FILE
Path for standard HNS mapping file. |
protected static java.lang.String |
HNS_UNUSED
Token for unused entry in mapping file. |
static int |
O_HAMSPACE
"hamspace" octet value. |
static int |
O_HAMVERSION40
"hamversion40" octet value. |
static int |
O_LIMIT
Octet limit value. |
static int |
O_NULL
"Null" octet value. |
protected char[] |
o2u
Map classic HNS octets to HNS-4 UCS codepoints. |
protected char |
U_HAMSPACE
"hamspace" UCS value. |
protected char |
U_HAMVERSION40
"hamversion40" UCS value. |
static char |
U_NULL
"Null" UCS value. |
protected java.util.HashMap<java.lang.Character,java.lang.Integer> |
u2o
Map HNS-4 UCS codepoints to classic HNS octets. |
| Constructor Summary | |
|---|---|
protected |
HNSOctetUCSMap(java.lang.String propspath,
boolean DO_ALL_UCS)
Constructs a new map as defined by the given properties file. |
| Method Summary | |
|---|---|
char |
cleanHNS8(char u)
Acts like hns8(char), unless the given character is a
whitespace character, in which case the result is the "null" HNS
value, 0. |
java.lang.String |
cleanHNS8(java.lang.String hns8,
int ix)
Returns a clean version of the given string, eliminating any invalid HNS-8 characters, and outputs a message mentioning the given index for each invalid character. |
java.lang.String |
cleanHNSU(java.lang.String hnsu,
int ix)
Returns a clean version of the given string, eliminating any invalid or whitespace HNS-UCS characters, and outputs a message mentioning the given index for each rejected character. |
char |
cleanUCS(int o)
Acts like ucs(int), unless the given code represents a
whitespace character, in which case the result is the "null" UCS
value, U+FFFF. |
protected static int |
getFirstPropsInt(java.util.Properties props,
java.lang.String istr)
Looks up the given string in the given properties set, and tries to interpret the first token in the result as an integer value, returning this value if successful, or the null UCS value otherwise. |
protected static java.lang.String |
getFirstPropsToken(java.util.Properties props,
java.lang.String istr)
Looks up the given string in the given properties set, and returns the first token in the result if possible, or returns null in any case of failure. |
static HNSOctetUCSMap |
getHNSMapOctetAllUCS()
Factory method, returning a the singleton map that includes all UCS HamNoSys character values. |
static HNSOctetUCSMap |
getHNSMapOctetHighUCS()
Factory method, returning the singleton map that includes high UCS HamNoSys character values only. |
static HNSOctetUCSMap |
getHNSMapOctetUCS(boolean DO_ALL_UCS)
Factory method, returning one of two singleton instances of this class, depending on the value of the given flag DO_ALL_UCS:
if this flag is false then only high (>= 256) character
values are included in the mapping, but if it is true all values,
including those such as UCS value 44 (hamcomma, for which
the corresponding value in the old 8-bit HNS code is the octet
value 36. |
char |
hns8(char u)
If the given character value is an HNS-4 UCS character, returns (as a character) the corresponding classic HNS octet, otherwise the "null" HNS value, 0. |
java.lang.String |
hns8(java.lang.String ustr)
Returns (as a character-string) the sequence of classic HNS octets corresponding to the given sequence of HNS-4 UCS characters. |
int |
octet(char u)
Returns the same value as hns8(char) (as an int). |
java.lang.String |
ucs(byte[] octets)
Returns the string of HNS-4 UCS characters corresponding to the given sequence of classic HNS octet values. |
char |
ucs(int o)
Returns the HNS-4 UCS character for the given classic HNS octet value. |
java.lang.String |
ucs(java.lang.String ostr)
Returns the string of HNS-4 UCS characters corresponding to the given string of classic HNS octet values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String HNS_UNUSED
protected static final java.lang.String HNS_OCTET_UCS_PROPS_FILE
public static final int O_NULL
public static final int O_LIMIT
public static final char U_NULL
public static final int O_HAMVERSION40
public static final int O_HAMSPACE
protected char[] o2u
protected java.util.HashMap<java.lang.Character,java.lang.Integer> u2o
protected final char U_HAMVERSION40
protected final char U_HAMSPACE
| Constructor Detail |
|---|
protected HNSOctetUCSMap(java.lang.String propspath,
boolean DO_ALL_UCS)
| Method Detail |
|---|
public static final HNSOctetUCSMap getHNSMapOctetHighUCS()
public static final HNSOctetUCSMap getHNSMapOctetAllUCS()
public static final HNSOctetUCSMap getHNSMapOctetUCS(boolean DO_ALL_UCS)
DO_ALL_UCS:
if this flag is false then only high (>= 256) character
values are included in the mapping, but if it is true all values,
including those such as UCS value 44 (hamcomma, for which
the corresponding value in the old 8-bit HNS code is the octet
value 36.
public char ucs(int o)
public char cleanUCS(int o)
ucs(int), unless the given code represents a
whitespace character, in which case the result is the "null" UCS
value, U+FFFF.
public java.lang.String ucs(byte[] octets)
public java.lang.String ucs(java.lang.String ostr)
public int octet(char u)
hns8(char) (as an int).
public char hns8(char u)
public char cleanHNS8(char u)
hns8(char), unless the given character is a
whitespace character, in which case the result is the "null" HNS
value, 0.
public java.lang.String hns8(java.lang.String ustr)
public java.lang.String cleanHNSU(java.lang.String hnsu,
int ix)
public java.lang.String cleanHNS8(java.lang.String hns8,
int ix)
protected static int getFirstPropsInt(java.util.Properties props,
java.lang.String istr)
protected static java.lang.String getFirstPropsToken(java.util.Properties props,
java.lang.String istr)
null in any case of failure.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||