info.codesaway.util.regex
Class Pattern.Range

java.lang.Object
  extended by info.codesaway.util.regex.Pattern.Range
Enclosing class:
Pattern

public static class Pattern.Range
extends java.lang.Object

Functions used to match a range of values e.g. 1 or 001..999; 001..999; 1..999


Field Summary
static Pattern floatValue
           
 
Constructor Summary
Pattern.Range()
           
 
Method Summary
static java.lang.String boundedRange(java.lang.String start, boolean inclusiveStart, java.lang.String end, boolean inclusiveEnd)
           
static int compare(java.lang.String value1, java.lang.String value2)
          Compares two integers numerically
static java.lang.String fPartRange(Pattern.Comparison comparison, java.lang.String iPart, java.lang.String fPart)
           
static java.lang.String iPartRange(Pattern.Comparison comparison, java.lang.String iPart)
           
static java.lang.String optionalTrailingZeros(java.lang.String rangeRegEx)
          Makes trailing zeros optional.
static java.lang.String unboundedRange(Pattern.Comparison comparison, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

floatValue

public static final Pattern floatValue
Constructor Detail

Pattern.Range

public Pattern.Range()
Method Detail

optionalTrailingZeros

public static java.lang.String optionalTrailingZeros(java.lang.String rangeRegEx)
Makes trailing zeros optional.

rangeRegEx uses the following grammar:

branch = parts ('|' parts)*

parts = part+

part = number | '[' (range | number)+ ']'

range = number '-' number

number = [0-9a-zA-Z]

Parameters:
rangeRegEx - the range regular expression
Returns:
the given range regular expression, with trailing zeros optional

boundedRange

public static java.lang.String boundedRange(java.lang.String start,
                                            boolean inclusiveStart,
                                            java.lang.String end,
                                            boolean inclusiveEnd)

unboundedRange

public static java.lang.String unboundedRange(Pattern.Comparison comparison,
                                              java.lang.String value)

iPartRange

public static java.lang.String iPartRange(Pattern.Comparison comparison,
                                          java.lang.String iPart)

fPartRange

public static java.lang.String fPartRange(Pattern.Comparison comparison,
                                          java.lang.String iPart,
                                          java.lang.String fPart)
Parameters:
iPart - the integer part
fPart - the fractional part

compare

public static int compare(java.lang.String value1,
                          java.lang.String value2)
Compares two integers numerically

Parameters:
value1 -
value2 -
Returns: