org.apache.fontbox.cmap

## Class CodespaceRange

- java.lang.Object
- - org.apache.fontbox.cmap.CodespaceRange

    public class CodespaceRange
    extends Object

This represents a single entry in the codespace range.

Author:
  Ben Litchfield

### Constructor Summary

Constructors
Constructor and Description
`CodespaceRange(byte[] startBytes, byte[] endBytes)` Creates a new instance of CodespaceRange.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getCodeLength()` Returns the length of the codes of the codespace.
`boolean` `isFullMatch(byte[] code, int codeLen)` Returns true if the given number of code bytes match this codespace range.
`boolean` `matches(byte[] code)` Returns true if the given code bytes match this codespace range.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CodespaceRange

    public CodespaceRange(byte[] startBytes,
                          byte[] endBytes)

Creates a new instance of CodespaceRange. The length of both arrays has to be the same.
For one byte ranges startBytes and endBytes define a linear range of values. Double byte values define a rectangular range not a linear range. Examples:
<00> <20> defines a linear range from 0x00 up to 0x20.
<8140> to <9FFC> defines a rectangular range. The high byte has to be within 0x81 and 0x9F and the low byte has to be within 0x40 and 0xFC

Parameters:
  `startBytes` - start of the range
  `endBytes` - start of the range

### Method Detail

#### getCodeLength

    public int getCodeLength()

Returns the length of the codes of the codespace.

Returns:
  the code length

#### matches

    public boolean matches(byte[] code)

Returns true if the given code bytes match this codespace range.

Parameters:
  `code` - the code bytes to be matched
Returns:
  true if the given code bytes match this codespace range

#### isFullMatch

    public boolean isFullMatch(byte[] code,
                               int codeLen)

Returns true if the given number of code bytes match this codespace range.

Parameters:
  `code` - the code bytes to be matched
  `codeLen` - the code length to be used for matching
Returns:
  true if the given number of code bytes match this codespace range