directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1622455 - /directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Chars.java
Date Thu, 04 Sep 2014 11:04:53 GMT
Author: elecharny
Date: Thu Sep  4 11:04:53 2014
New Revision: 1622455

URL: http://svn.apache.org/r1622455
Log:
o Added a method to check if a char is an alphanumeric or '-'
o Some code formating

Modified:
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Chars.java

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Chars.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Chars.java?rev=1622455&r1=1622454&r2=1622455&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Chars.java (original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Chars.java Thu
Sep  4 11:04:53 2014
@@ -115,17 +115,17 @@ public final class Chars
             false, false, false, false, false, false, false, false,
             false, false, false, false, false, false, false, false,
             false, false, false, false, false, false, false, false,
-            false, false, false, false, false, true, false, false,
-            true, true, true, true, true, true, true, true,
-            true, true, false, false, false, false, false, false,
-            false, true, true, true, true, true, true, true,
-            true, true, true, true, true, true, true, true,
-            true, true, true, true, true, true, true, true,
-            true, true, true, false, false, false, false, false,
-            false, true, true, true, true, true, true, true,
-            true, true, true, true, true, true, true, true,
-            true, true, true, true, true, true, true, true,
-            true, true, true, false, false, false, false, false
+            false, false, false, false, false, true,  false, false,
+            true,  true,  true,  true,  true,  true,  true,  true,
+            true,  true,  false, false, false, false, false, false,
+            false, true,  true,  true,  true,  true,  true,  true,
+            true,  true,  true,  true,  true,  true,  true,  true,
+            true,  true,  true,  true,  true,  true,  true,  true,
+            true,  true,  true,  false, false, false, false, false,
+            false, true,  true,  true,  true,  true,  true,  true,
+            true,  true,  true,  true,  true,  true,  true,  true,
+            true,  true,  true,  true,  true,  true,  true,  true,
+            true,  true,  true,  false, false, false, false, false
     };
     /** '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' */
     public static final boolean[] DIGIT =
@@ -622,6 +622,19 @@ public final class Chars
 
 
     /**
+     * Check if the current character is an 7 bits ASCII CHAR (between 0 and
+     * 127). <char> ::= <alpha> | <digit> | '-'
+     *
+     * @param c The char we want to check
+     * @return The position of the next character, if the current one is a CHAR.
+     */
+    public static boolean isAlphaDigitMinus( char c )
+    {
+        return ( ( c & 0x007F ) == c ) && CHAR[c];
+    }
+
+
+    /**
      * Test if the current character is a bit, ie 0 or 1.
      *
      * @param string



Mime
View raw message