Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.pdfbox.cmaptypes
Class CMap

    java.lang.Object
      org.pdfbox.cmaptypes.CMap

public class CMap
extends Object

This class represents a CMap file.

Version:
  $Revision: 1.6 $
Author:
  Ben Litchfield (ben@csh.rit.edu)

Constructor Summary
`CMap()` Creates a new instance of CMap.

Method Summary
`void` | `addCodespaceRange(CodespaceRange range)` This will add a codespace range.
`void` | `addMapping(byte[] src, String dest)` This will add a mapping.
`List` | `getCodeSpaceRanges()` Getter for property codeSpaceRanges.
`boolean` | `hasOneByteMappings()` This will tell if this cmap has any one byte mappings.
`boolean` | `hasTwoByteMappings()` This will tell if this cmap has any two byte mappings.
`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`

Constructor Detail

### CMap

    public CMap()

  Creates a new instance of CMap.

Method Detail

### hasOneByteMappings

    public boolean hasOneByteMappings()

  This will tell if this cmap has any one byte mappings.

  Returns:
    true If there are any one byte mappings, false otherwise.

### hasTwoByteMappings

    public boolean hasTwoByteMappings()

  This will tell if this cmap has any two byte mappings.

  Returns:
    true If there are any two byte mappings, false otherwise.

### lookup

    public 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

    public void addMapping(byte[] src,
                           String dest)
                    throws IOException

  This will add a mapping.

  Parameters:
    `src` - The src to the mapping.
    `dest` - The dest to the mapping.
  Throws:
    `IOException` - if the src is invalid.

### addCodespaceRange

    public void addCodespaceRange(CodespaceRange range)

  This will add a codespace range.

  Parameters:
    `range` - A single codespace range.

### getCodeSpaceRanges

    public List getCodeSpaceRanges()

  Getter for property codeSpaceRanges.

  Returns:
    Value of property codeSpaceRanges.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD