Class PatternProps


  • public final class PatternProps
    extends java.lang.Object
    Implements the immutable Unicode properties Pattern_Syntax and Pattern_White_Space. Hardcodes these properties, does not load data, does not depend on other ICU classes.

    Note: Both properties include ASCII as well as non-ASCII, non-Latin-1 code points, and both properties only include BMP code points (no supplementary ones). Pattern_Syntax includes some unassigned code points.

    [:Pattern_White_Space:] = [ - \ …‎‏

]

    [:Pattern_Syntax:] = [!-/\:-@\[-\^`\{-~¡-§©«¬® °±¶»¿×÷ ‐-‧‰-‾⁁-⁓⁕-⁞ ←-⑟─-❵➔-⯿⸀-⹿ 、-〃〈-〠〰﴾﴿﹅﹆]

    • Constructor Summary

      Constructors 
      Constructor Description
      PatternProps()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isIdentifier​(java.lang.CharSequence s)
      Tests whether the CharSequence contains a "pattern identifier", that is, whether it contains only non-Pattern_White_Space, non-Pattern_Syntax characters.
      static boolean isIdentifier​(java.lang.CharSequence s, int start, int limit)
      Tests whether the CharSequence contains a "pattern identifier", that is, whether it contains only non-Pattern_White_Space, non-Pattern_Syntax characters.
      static boolean isSyntax​(int c)  
      static boolean isSyntaxOrWhiteSpace​(int c)  
      static boolean isWhiteSpace​(int c)  
      static int skipIdentifier​(java.lang.CharSequence s, int i)
      Skips over a "pattern identifier" starting at index i of the CharSequence.
      static int skipWhiteSpace​(java.lang.CharSequence s, int i)
      Skips over Pattern_White_Space starting at index i of the CharSequence.
      static java.lang.String trimSpaceChar​(java.lang.String s)  
      static java.lang.String trimWhiteSpace​(java.lang.String s)  
      • Methods inherited from class java.lang.Object

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

      • latin1

        private static final byte[] latin1
      • index2000

        private static final byte[] index2000
      • syntax2000

        private static final int[] syntax2000
      • syntaxOrWhiteSpace2000

        private static final int[] syntaxOrWhiteSpace2000
    • Constructor Detail

      • PatternProps

        public PatternProps()
    • Method Detail

      • isSyntax

        public static boolean isSyntax​(int c)
        Returns:
        true if c is a Pattern_Syntax code point.
      • isSyntaxOrWhiteSpace

        public static boolean isSyntaxOrWhiteSpace​(int c)
        Returns:
        true if c is a Pattern_Syntax or Pattern_White_Space code point.
      • isWhiteSpace

        public static boolean isWhiteSpace​(int c)
        Returns:
        true if c is a Pattern_White_Space character.
      • skipWhiteSpace

        public static int skipWhiteSpace​(java.lang.CharSequence s,
                                         int i)
        Skips over Pattern_White_Space starting at index i of the CharSequence.
        Returns:
        The smallest index at or after i with a non-white space character.
      • trimWhiteSpace

        public static java.lang.String trimWhiteSpace​(java.lang.String s)
        Returns:
        s except with leading and trailing Pattern_White_Space removed.
      • trimSpaceChar

        public static java.lang.String trimSpaceChar​(java.lang.String s)
        Returns:
        s except with leading and trailing SpaceChar characters removed.
      • isIdentifier

        public static boolean isIdentifier​(java.lang.CharSequence s)
        Tests whether the CharSequence contains a "pattern identifier", that is, whether it contains only non-Pattern_White_Space, non-Pattern_Syntax characters.
        Returns:
        true if there are no Pattern_White_Space or Pattern_Syntax characters in s.
      • isIdentifier

        public static boolean isIdentifier​(java.lang.CharSequence s,
                                           int start,
                                           int limit)
        Tests whether the CharSequence contains a "pattern identifier", that is, whether it contains only non-Pattern_White_Space, non-Pattern_Syntax characters.
        Returns:
        true if there are no Pattern_White_Space or Pattern_Syntax characters in s between start and (exclusive) limit.
      • skipIdentifier

        public static int skipIdentifier​(java.lang.CharSequence s,
                                         int i)
        Skips over a "pattern identifier" starting at index i of the CharSequence.
        Returns:
        The smallest index at or after i with a Pattern_White_Space or Pattern_Syntax character.