SSF.OS.BGP4.Util
Class Parsing

java.lang.Object
  |
  +--SSF.OS.BGP4.Util.Parsing

public class Parsing
extends java.lang.Object

Public utility methods useful for parsing-related tasks.


Field Summary
static java.lang.String int_list_regexp
          A regular expression for matching a comma-separated list of integers
static java.lang.String int_range_regexp
          A regular expression for matching an integer range.
 
Constructor Summary
Parsing()
           
 
Method Summary
static boolean matchInt(java.lang.String matcher, int intval)
          Determines whether or not an integer is matched by a given list or range expression.
static boolean matchIntList(java.lang.String matcher, int intval)
          Determines whether or not an integer is in a given integer list.
static boolean matchIntRange(java.lang.String matcher, int intval)
          Determines whether or not an integer is in a given integer range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

int_list_regexp

public static final java.lang.String int_list_regexp
A regular expression for matching a comma-separated list of integers

See Also:
Constant Field Values

int_range_regexp

public static final java.lang.String int_range_regexp
A regular expression for matching an integer range.

See Also:
Constant Field Values
Constructor Detail

Parsing

public Parsing()
Method Detail

matchInt

public static final boolean matchInt(java.lang.String matcher,
                                     int intval)
Determines whether or not an integer is matched by a given list or range expression.

Parameters:
matcher - A list or range of integers.
intval - An integer to test against the matcher.
Returns:
whether or not the integer matched the list/range

matchIntList

public static final boolean matchIntList(java.lang.String matcher,
                                         int intval)
Determines whether or not an integer is in a given integer list. Does not check that the integer list is of the correct format. (Refer to matchInt.

Parameters:
matcher - A list of integers.
intval - An integer to test against the list.
Returns:
whether or not the integer was in the list
See Also:
matchInt(java.lang.String, int)

matchIntRange

public static final boolean matchIntRange(java.lang.String matcher,
                                          int intval)
Determines whether or not an integer is in a given integer range. Does not check that the integer range is of the correct format. (Refer to matchInt.

Parameters:
matcher - A range of integers.
intval - An integer to test against the range.
Returns:
whether or not the integer was in the range
See Also:
matchInt(java.lang.String, int)