Package org.jppf.net
Class RangePattern
java.lang.Object
org.jppf.net.RangePattern
- Direct Known Subclasses:
AbstractIPAddressPattern
Represents a pattern used for IP addresses inclusion or exclusion lists.
A pattern represents a single value or a range of values for each component of an IP address.
A pattern represents a single value or a range of values for each component of an IP address.
- Author:
- Laurent Cohen
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRangePattern(String source, PatternConfiguration config) Initialize this object with the specified string pattern. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconvertSource(String source) Convert the specified source into an IP pattern.booleanmatches(int... values) Determine whether the specified IP address matches this pattern.protected StringpostProcess(String source) Perform post-processing of the source string before applying common transformations.protected StringpreProcess(String source) Perform pre-processing of the source string before applying common transformations.toString()
-
Field Details
-
ranges
The list of ranges constituting this address pattern. -
config
The configuration used for this pattern.
-
-
Constructor Details
-
RangePattern
Initialize this object with the specified string pattern.- Parameters:
source- the source pattern as a string.config- the configuration used for this pattern.- Throws:
IllegalArgumentException- if the pattern is null or invalid.
-
-
Method Details
-
convertSource
Convert the specified source into an IP pattern.- Parameters:
source- the source pattern as a string.- Throws:
IllegalArgumentException- if the pattern is null or invalid.
-
preProcess
Perform pre-processing of the source string before applying common transformations.- Parameters:
source- the pattern source to process.- Returns:
- a new processed string.
-
postProcess
Perform post-processing of the source string before applying common transformations.- Parameters:
source- the pattern source to process.- Returns:
- a new processed string.
-
matches
public boolean matches(int... values) Determine whether the specified IP address matches this pattern. No check is made to verify that the IP address is valid.- Parameters:
values- the ip address to match as a array of values representing its components.- Returns:
- true if the address matches this pattern, false otherwise.
-
toString
-