util

## Class HNSOctetUCSMap

- java.lang.Object
- - util.HNSOctetUCSMap

-     public class HNSOctetUCSMap
      extends java.lang.Object

  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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `O_LIMIT` Octet limit value.
    `static int` | `O_NULL` "Null" octet value.
    `static char` | `U_NULL` "Null" UCS value.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 returns the original argument character unchanged.
    `int` | `octet(char u)` Returns the classic HNS octet value for the given HNS-4 UCS character.
    `java.lang.String` | `octet(java.lang.String ustr)` Returns (as a charater-string) the sequence of classic HNS octets corresponding to the given sequence of HNS-4 UCS characters.
    `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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### O_NULL

          public static final int O_NULL

      "Null" octet value.
      See Also:
        Constant Field Values

    - #### O_LIMIT

          public static final int O_LIMIT

      Octet limit value.
      See Also:
        Constant Field Values

    - #### U_NULL

          public static final char U_NULL

      "Null" UCS value.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getHNSMapOctetHighUCS

          public static final HNSOctetUCSMap getHNSMapOctetHighUCS()

      Factory method, returning the singleton map that includes high UCS HamNoSys character values only.

    - #### getHNSMapOctetAllUCS

          public static final HNSOctetUCSMap getHNSMapOctetAllUCS()

      Factory method, returning a the singleton map that includes all UCS HamNoSys character values.

    - #### getHNSMapOctetUCS

          public static final 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.

    - #### ucs

          public char ucs(int o)

      Returns the HNS-4 UCS character for the given classic HNS octet value.

    - #### ucs

          public java.lang.String ucs(byte[] octets)

      Returns the string of HNS-4 UCS characters corresponding to the given sequence of classic HNS octet values.

    - #### ucs

          public 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.

    - #### hns8

          public 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 returns the original argument character unchanged.

    - #### octet

          public int octet(char u)

      Returns the classic HNS octet value for the given HNS-4 UCS character.

    - #### octet

          public java.lang.String octet(java.lang.String ustr)

      Returns (as a charater-string) the sequence of classic HNS octets corresponding to the given sequence of HNS-4 UCS characters.