Package org.jppf.net

Class RangePattern

java.lang.Object
org.jppf.net.RangePattern
Direct Known Subclasses:
AbstractIPAddressPattern

public class RangePattern extends Object
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.
Author:
Laurent Cohen
  • Field Details

    • ranges

      protected final List<Range<Integer>> ranges
      The list of ranges constituting this address pattern.
    • config

      protected final PatternConfiguration config
      The configuration used for this pattern.
  • Constructor Details

  • Method Details

    • convertSource

      protected void convertSource(String source) throws IllegalArgumentException
      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

      protected String preProcess(String source)
      Perform pre-processing of the source string before applying common transformations.
      Parameters:
      source - the pattern source to process.
      Returns:
      a new processed string.
    • postProcess

      protected String postProcess(String source)
      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

      public String toString()
      Overrides:
      toString in class Object