Class USerializedSet


  • public final class USerializedSet
    extends java.lang.Object
    Simple class for handling serialized USet/UnicodeSet structures without object creation. See ICU4C icu/source/common/uset.c.
    • Constructor Summary

      Constructors 
      Constructor Description
      USerializedSet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(int c)
      Returns true if the given USerializedSet contains the given character.
      int countRanges()
      Returns the number of disjoint ranges of characters contained in the given serialized set.
      boolean getRange​(int rangeIndex, int[] range)
      Returns a range of characters contained in the given serialized set.
      boolean getSet​(char[] src, int srcStart)
      Fill in the given serialized set object.
      void setToOne​(int c)
      Set the USerializedSet to contain the given character (and nothing else).
      • Methods inherited from class java.lang.Object

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

      • array

        private char[] array
      • arrayOffset

        private int arrayOffset
      • bmpLength

        private int bmpLength
      • length

        private int length
    • Constructor Detail

      • USerializedSet

        public USerializedSet()
    • Method Detail

      • getSet

        public final boolean getSet​(char[] src,
                                    int srcStart)
        Fill in the given serialized set object.
        Parameters:
        src - pointer to start of array
        srcStart - pointer to start of serialized data (length value)
        Returns:
        true if the given array is valid, otherwise false
      • setToOne

        public final void setToOne​(int c)
        Set the USerializedSet to contain the given character (and nothing else).
      • getRange

        public final boolean getRange​(int rangeIndex,
                                      int[] range)
        Returns a range of characters contained in the given serialized set.
        Parameters:
        rangeIndex - a non-negative integer in the range 0.. getSerializedRangeCount()-1
        range - variable to receive the data in the range
        Returns:
        true if rangeIndex is valid, otherwise false
      • contains

        public final boolean contains​(int c)
        Returns true if the given USerializedSet contains the given character.
        Parameters:
        c - the character to test for
        Returns:
        true if set contains c
      • countRanges

        public final int countRanges()
        Returns the number of disjoint ranges of characters contained in the given serialized set. Ignores any strings contained in the set.
        Returns:
        a non-negative integer counting the character ranges contained in set