Class CIDRange


  • class CIDRange
    extends java.lang.Object
    Range of continuous CIDs between two Unicode characters.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int cid  
      private char from  
      private char to  
    • Constructor Summary

      Constructors 
      Constructor Description
      CIDRange​(char from, char to, int cid)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean extend​(char newFrom, char newTo, int newCid)
      Check if the given values represent a consecutive range of the given range.
      int map​(char ch)
      Maps the given Unicode character to the corresponding CID in this range.
      int unmap​(int code)
      Maps the given CID to the corresponding Unicode character in this range.
      • Methods inherited from class java.lang.Object

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

      • from

        private final char from
      • to

        private char to
      • cid

        private final int cid
    • Constructor Detail

      • CIDRange

        CIDRange​(char from,
                 char to,
                 int cid)
    • Method Detail

      • map

        public int map​(char ch)
        Maps the given Unicode character to the corresponding CID in this range.
        Parameters:
        ch - Unicode character
        Returns:
        corresponding CID, or -1 if the character is out of range
      • unmap

        public int unmap​(int code)
        Maps the given CID to the corresponding Unicode character in this range.
        Parameters:
        code - CID
        Returns:
        corresponding Unicode character, or -1 if the CID is out of range
      • extend

        public boolean extend​(char newFrom,
                              char newTo,
                              int newCid)
        Check if the given values represent a consecutive range of the given range. If so, extend the given range instead of creating a new one.
        Parameters:
        newFrom - start value of the new range
        newTo - end value of the new range
        newCid - start CID value of the range
        Returns:
        true if the given range was extended