Class GlyphClassTable

  • All Implemented Interfaces:
    GlyphClassMapping

    public final class GlyphClassTable
    extends GlyphMappingTable
    implements GlyphClassMapping

    Base class implementation of glyph class table.

    This work was originally authored by Glenn Adams (gadams@apache.org).

    • Field Detail

      • GLYPH_CLASS_TYPE_EMPTY

        public static final int GLYPH_CLASS_TYPE_EMPTY
        empty mapping table
        See Also:
        Constant Field Values
      • GLYPH_CLASS_TYPE_MAPPED

        public static final int GLYPH_CLASS_TYPE_MAPPED
        mapped mapping table
        See Also:
        Constant Field Values
      • GLYPH_CLASS_TYPE_RANGE

        public static final int GLYPH_CLASS_TYPE_RANGE
        range based mapping table
        See Also:
        Constant Field Values
      • GLYPH_CLASS_TYPE_COVERAGE_SET

        public static final int GLYPH_CLASS_TYPE_COVERAGE_SET
        empty mapping table
        See Also:
        Constant Field Values
    • Method Detail

      • getType

        public int getType()
        Obtain mapping type.
        Overrides:
        getType in class GlyphMappingTable
        Returns:
        mapping format type
      • getEntries

        public java.util.List getEntries()
        Obtain mapping entries.
        Overrides:
        getEntries in class GlyphMappingTable
        Returns:
        list of mapping entries
      • getClassSize

        public int getClassSize​(int set)
        Obtain size of class table, i.e., ciMax + 1, where ciMax is the maximum class index.
        Specified by:
        getClassSize in interface GlyphClassMapping
        Parameters:
        set - for coverage set based class mappings, indicates set index, otherwise ignored
        Returns:
        size of class table
      • getClassIndex

        public int getClassIndex​(int gid,
                                 int set)
        Map glyph identifier (code) to coverge index. Returns -1 if glyph identifier is not in the domain of the class table.
        Specified by:
        getClassIndex in interface GlyphClassMapping
        Parameters:
        gid - glyph identifier (code)
        set - for coverage set based class mappings, indicates set index, otherwise ignored
        Returns:
        non-negative glyph class index or -1 if glyph identifiers is not mapped by table
      • createClassTable

        public static GlyphClassTable createClassTable​(java.util.List entries)
        Create glyph class table.
        Parameters:
        entries - list of mapped or ranged class entries, or null or empty list
        Returns:
        a new covera table instance