9319db5d07e7a5aeb5a00630cb22f60c324480cd
[jalview.git] / src / com / stevesoft / pat / Prop.java
1 //\r
2 // This software is now distributed according to\r
3 // the Lesser Gnu Public License.  Please see\r
4 // http://www.gnu.org/copyleft/lesser.txt for\r
5 // the details.\r
6 //    -- Happy Computing!\r
7 //\r
8 package com.stevesoft.pat;\r
9 \r
10 /** Get Unicode properties for a character.  See\r
11 <a href="http://unicode.org">http://unicode.org</a>. */\r
12 public class Prop {\r
13     /** Is this a "Decimal Digit" according to Unicode? */\r
14     public final static boolean isDecimalDigit(char c) {\r
15       if(Bits.decimal_digit == null)\r
16         Bits.decimal_digit_f();\r
17       return Bits.decimal_digit.get(c);\r
18     }\r
19     /** Is this a "Alphabetic" according to Unicode? */\r
20     public final static boolean isAlphabetic(char c) {\r
21       if(Bits.letter == null)\r
22         Bits.letter_f();\r
23       return Bits.letter.get(c);\r
24     }\r
25     /** Is this a "Math" according to Unicode? */\r
26     public final static boolean isMath(char c) {\r
27       if(Bits.math == null)\r
28         Bits.math_f();\r
29       return Bits.math.get(c);\r
30     }\r
31 \r
32     /** Is this a "Currency" according to Unicode? */\r
33     public final static boolean isCurrency(char c) {\r
34       if(Bits.currency == null)\r
35         Bits.currency_f();\r
36       return Bits.currency.get(c);\r
37     }\r
38 \r
39     /** Is c a white space character according to Unicode? */\r
40     public final static boolean isWhite(char c) {\r
41       if(Bits.white == null)\r
42         Bits.white_f();\r
43       return Bits.white.get(c);\r
44     }\r
45 \r
46     /** Is c a punctuation character according to Unicode? */\r
47     public final static boolean isPunct(char c) {\r
48       if(Bits.punct == null)\r
49         Bits.punct_f();\r
50       return Bits.punct.get(c);\r
51     }\r
52 }\r