Class ResolvedPatternElementFactory

Object
com.owenfeehan.pathpatternfinder.patternelements.resolved.ResolvedPatternElementFactory

public class ResolvedPatternElementFactory
extends Object
Creation of the different types of resolved elements.
Author:
Owen Feehan
  • Method Details

    • constant

      public static PatternElement constant​(char value)
      Creates constant element of a single character.
      Parameters:
      value - the character
      Returns:
      a newly created element
    • constant

      public static PatternElement constant​(String value)
      Creates constant element of a string.
      Parameters:
      value - the string
      Returns:
      a newly created element
    • integer

      public static PatternElement integer​(int... values)
      Creates a varying integer element of one or more ints.
      Parameters:
      values - the ints that vary
      Returns:
      a newly created element
    • integer

      public static PatternElement integer​(List<String> values)
      Creates a varying integer element of one more strings.
      Parameters:
      values - the strings that vary
      Returns:
      a newly created element
    • string

      public static PatternElement string​(String... values)
      Creates a varying string element of one or more strings.
      Parameters:
      values - the strings that vary
      Returns:
      a newly created element
    • string

      public static PatternElement string​(List<String> values)
      Creates a varying string element from a list of strings.
      Parameters:
      values - the strings that vary
      Returns:
      a newly created element
    • directorySeperator

      public static PatternElement directorySeperator()
      Creates an element representing a directory separator.

      e.g. this is a forward-slash on Unix or a backslash on Windows.

      Returns:
      a newly created element
    • addConstantAndDirectoryTo

      public static void addConstantAndDirectoryTo​(String value, Pattern pattern)
      Like addConstantTo(String,Pattern) but additionally adds a directory separator.
      Parameters:
      value - the value for the constant element
      pattern - the pattern to add to
    • addConstantTo

      public static PatternElement addConstantTo​(String value, Pattern pattern)
      Creates a new constant element from a string, and adds to pattern.
      Parameters:
      value - the value for the constant element
      pattern - the pattern to add to
      Returns:
      the element that was added
    • addConstantTo

      public static PatternElement addConstantTo​(char value, Pattern pattern)
      Creates a new constant element from a character, and adds to pattern.
      Parameters:
      value - the value for the constant element
      pattern - the pattern to add to
      Returns:
      the element that was added
    • addDirectorySeperatorTo

      public static void addDirectorySeperatorTo​(Pattern pattern)
      Creates a new directory-seperator element, and adds to pattern.
      Parameters:
      pattern - the pattern to add to