Class CMapStrings


  • public class CMapStrings
    extends java.lang.Object
    Many CMaps are using the same values for the mapped strings. This class provides all common one- and two-byte mappings to avoid duplicate strings.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.List<java.lang.Integer> indexValues  
      private static java.util.List<java.lang.String> oneByteMappings  
      private static java.util.List<byte[]> oneByteValues  
      private static java.util.List<java.lang.String> twoByteMappings  
      private static java.util.List<byte[]> twoByteValues  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CMapStrings()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void fillMappings()  
      static byte[] getByteValue​(byte[] bytes)
      Get a singleton instance of the given combination of bytes to avoid multiple instances for same value.
      static java.lang.Integer getIndexValue​(byte[] bytes)
      Get an Integer instance of the given combination of bytes.
      static java.lang.String getMapping​(byte[] bytes)
      Get the mapped string value for the given combination of bytes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • twoByteMappings

        private static final java.util.List<java.lang.String> twoByteMappings
      • oneByteMappings

        private static final java.util.List<java.lang.String> oneByteMappings
      • indexValues

        private static final java.util.List<java.lang.Integer> indexValues
      • oneByteValues

        private static final java.util.List<byte[]> oneByteValues
      • twoByteValues

        private static final java.util.List<byte[]> twoByteValues
    • Constructor Detail

      • CMapStrings

        private CMapStrings()
    • Method Detail

      • fillMappings

        private static void fillMappings()
      • getMapping

        public static java.lang.String getMapping​(byte[] bytes)
        Get the mapped string value for the given combination of bytes. The mapping is limited to one and two-byte mappings. Any longer byte sequence produces null as return value.
        Parameters:
        bytes - the given combination of bytes
        Returns:
        the string representation for the given combination of bytes
      • getIndexValue

        public static java.lang.Integer getIndexValue​(byte[] bytes)
        Get an Integer instance of the given combination of bytes. Each value is a singleton to avoid multiple instances for same value. The values are limited to one and two-byte sequences. Any longer byte sequence produces null as return value.
        Parameters:
        bytes - the given combination of bytes
        Returns:
        the Integer representation for the given combination of bytes
      • getByteValue

        public static byte[] getByteValue​(byte[] bytes)
        Get a singleton instance of the given combination of bytes to avoid multiple instances for same value. The values are limited to one and two-byte sequences. Any longer byte sequence produces null as return value.
        Parameters:
        bytes - the given combination of bytes
        Returns:
        a singleton instance for the given combination of bytes