org.opennms.core.utils
Class IPLike

java.lang.Object
  extended by org.opennms.core.utils.IPLike

public abstract class IPLike
extends Object

IPLike class.

Version:
$Id: $
Author:
ranger

Constructor Summary
IPLike()
           
 
Method Summary
static int countChar(char charIn, String stingIn)
          countChar
static boolean matches(InetAddress address, String pattern)
           
static boolean matches(String address, String pattern)
          matches
static boolean matchNumericListOrRange(String value, String patterns)
           
static boolean matchNumericListOrRange(String value, String patterns, org.opennms.core.utils.IPLike.RangeMatcher matcher)
          Use this method to match ranges, lists, and specific number strings such as: "200-300" or "200,300,501-700" "*" matches any This method is commonly used for matching IP octets or ports
static boolean matchRange(String value, String pattern)
          Helper method in support of matchNumericListOrRange
static boolean matchRangeHex(String value, String pattern)
          Helper method in support of matchNumericListOrRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPLike

public IPLike()
Method Detail

matches

public static boolean matches(InetAddress address,
                              String pattern)

matches

public static boolean matches(String address,
                              String pattern)

matches

Parameters:
address - a String object.
pattern - a String object.
Returns:
a boolean.

matchNumericListOrRange

public static boolean matchNumericListOrRange(String value,
                                              String patterns)

matchNumericListOrRange

public static boolean matchNumericListOrRange(String value,
                                              String patterns,
                                              org.opennms.core.utils.IPLike.RangeMatcher matcher)
Use this method to match ranges, lists, and specific number strings such as: "200-300" or "200,300,501-700" "*" matches any This method is commonly used for matching IP octets or ports

Parameters:
value - a String object.
patterns - a String object.
Returns:
a boolean.

matchRange

public static boolean matchRange(String value,
                                 String pattern)
Helper method in support of matchNumericListOrRange

Parameters:
value - a String object.
pattern - a String object.
Returns:
a boolean.

matchRangeHex

public static boolean matchRangeHex(String value,
                                    String pattern)
Helper method in support of matchNumericListOrRange

Parameters:
value - a String object.
pattern - a String object.
Returns:
a boolean.

countChar

public static int countChar(char charIn,
                            String stingIn)

countChar

Parameters:
charIn - a char.
stingIn - a String object.
Returns:
a int.


Copyright © 2011. All Rights Reserved.