Class CMap


  • public class CMap
    extends java.lang.Object
    This class represents a CMap file.
    Since:
    2.1.4
    • Constructor Summary

      Constructors 
      Constructor Description
      CMap()
      Creates a new instance of CMap.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addCodespaceRange​(CodespaceRange range)
      This will add a codespace range.
      (package private) void addMapping​(byte[] src, java.lang.String dest)
      This will add a mapping.
      java.util.List getCodeSpaceRanges()
      Getter for property codeSpaceRanges.
      java.lang.String lookup​(byte[] code, int offset, int length)
      This will perform a lookup into the map.
      • Methods inherited from class java.lang.Object

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

      • codeSpaceRanges

        private final java.util.List codeSpaceRanges
      • singleByteMappings

        private final java.util.Map singleByteMappings
      • doubleByteMappings

        private final java.util.Map doubleByteMappings
    • Constructor Detail

      • CMap

        public CMap()
        Creates a new instance of CMap.
    • Method Detail

      • lookup

        public java.lang.String lookup​(byte[] code,
                                       int offset,
                                       int length)
        This will perform a lookup into the map.
        Parameters:
        code - The code used to lookup.
        offset - The offset into the byte array.
        length - The length of the data we are getting.
        Returns:
        The string that matches the lookup.
      • addMapping

        void addMapping​(byte[] src,
                        java.lang.String dest)
                 throws java.io.IOException
        This will add a mapping.
        Parameters:
        src - The src to the mapping.
        dest - The dest to the mapping.
        Throws:
        java.io.IOException - if the src is invalid.
      • addCodespaceRange

        void addCodespaceRange​(CodespaceRange range)
        This will add a codespace range.
        Parameters:
        range - A single codespace range.
      • getCodeSpaceRanges

        public java.util.List getCodeSpaceRanges()
        Getter for property codeSpaceRanges.
        Returns:
        Value of property codeSpaceRanges.