net.sf.saxon.regex

## Class BMPString

- java.lang.Object
- - net.sf.saxon.regex.UnicodeString
  - - net.sf.saxon.regex.BMPString

-     public final class BMPString
      extends UnicodeString

  An implementation of UnicodeString optimized for strings that contain no characters outside the BMP (i.e. no characters whose codepoints exceed 65535)

- - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.regex.UnicodeString

      `EMPTY_STRING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BMPString(CharSequence src)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `charAt(int pos)` Get the character at a specified position
    `CharSequence` | `getCharSequence()` Get the value of this UnicodeString as a CharSequence
    `int` | `indexOf(int search, int pos)` Get the first match for a given character
    `boolean` | `isEnd(int pos)` Ask whether a given position is at (or beyond) the end of the string
    `int` | `length()` Get the length of the string, in Unicode codepoints
    `UnicodeString` | `substring(int beginIndex, int endIndex)` Get a substring of this string
    `String` | `toString()`

    - ### Methods inherited from class net.sf.saxon.regex.UnicodeString

      `containsSurrogatePairs, makeUnicodeString, makeUnicodeString`

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

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

- - ### Constructor Detail

    - #### BMPString

          public BMPString(CharSequence src)

      Parameters:
        `src` - - encapsulated CharSequence. The client must ensure that this contains no surrogate pairs

  - ### Method Detail

    - #### substring

          public UnicodeString substring(int beginIndex,
                                int endIndex)

      Description copied from class: `UnicodeString`
      Get a substring of this string
      Specified by:
        `substring` in class `UnicodeString`
      Parameters:
        `beginIndex` - the index of the first character to be included (counting codepoints, not 16-bit characters)
        `endIndex` - the index of the first character to be NOT included (counting codepoints, not 16-bit characters)
      Returns:
        a substring

    - #### charAt

          public int charAt(int pos)

      Description copied from class: `UnicodeString`
      Get the character at a specified position
      Specified by:
        `charAt` in class `UnicodeString`
      Parameters:
        `pos` - the index of the required character (counting codepoints, not 16-bit characters)
      Returns:
        a character (Unicode codepoint) at the specified position.

    - #### indexOf

          public int indexOf(int search,
                    int pos)

      Description copied from class: `UnicodeString`
      Get the first match for a given character
      Specified by:
        `indexOf` in class `UnicodeString`
      Parameters:
        `search` - the character to look for
        `pos` - the first position to look
      Returns:
        the position of the first occurrence of the sought character, or -1 if not found

    - #### length

          public int length()

      Description copied from class: `UnicodeString`
      Get the length of the string, in Unicode codepoints
      Specified by:
        `length` in class `UnicodeString`
      Returns:
        the number of codepoints in the string

    - #### isEnd

          public boolean isEnd(int pos)

      Description copied from class: `UnicodeString`
      Ask whether a given position is at (or beyond) the end of the string
      Specified by:
        `isEnd` in class `UnicodeString`
      Parameters:
        `pos` - the index of the required character (counting codepoints, not 16-bit characters)
      Returns:
        `true` iff if the specified index is after the end of the character stream

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getCharSequence

          public CharSequence getCharSequence()

      Description copied from class: `UnicodeString`
      Get the value of this UnicodeString as a CharSequence
      Specified by:
        `getCharSequence` in class `UnicodeString`
      Returns:
        a CharSequence representing the same characters as this UnicodeString

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.