Class UnresolvedPatternElementFactory

Object
com.owenfeehan.pathpatternfinder.patternelements.unresolved.UnresolvedPatternElementFactory

public class UnresolvedPatternElementFactory
extends Object
Creates Patterns or PatternElements which have yet to be resolved or adds a new such unresolved Element to an existing Pattern.
Author:
Owen Feehan
  • Constructor Details

    • UnresolvedPatternElementFactory

      public UnresolvedPatternElementFactory​(IOCase ioCase)
      Creates with a particular case-sensitivity.
      Parameters:
      ioCase - specifies the case-sensitivity to use when comparing strings.
  • Method Details

    • stringComparer

      public CasedStringComparer stringComparer()
      The comparer uses for strings, with particular case-sensitivity specified.
      Returns:
      the comparer
    • createUnresolvedString

      public Pattern createUnresolvedString​(List<String> list, boolean requiresPeriod)
      Creates a Pattern with a single-unresolved-string as element
      Parameters:
      list - input-list
      requiresPeriod - if true, a constant string will only be trimmed from the right if it includes at
      Returns:
      the newly created pattern
    • createUnresolvedString

      public Pattern createUnresolvedString​(List<PatternElement> left, List<String> right, boolean requiresPeriod)
      Creates a Pattern with an elements on the left, and a unresolved-string on the right
      Parameters:
      left - left-most elements
      right - right-most element
      requiresPeriod - if true, a constant string will only be trimmed from the right if it includes at
      Returns:
      the newly created pattern
    • createUnresolvedString

      public Pattern createUnresolvedString​(PatternElement left, List<String> right, boolean requiresPeriod)
      Creates a Pattern with an element on the left, and a unresolved-string on the right
      Parameters:
      left - left-most element
      right - right-most element
      requiresPeriod - if true, a constant string will only be trimmed from the right if it includes at
      Returns:
      the newly created pattern
    • addUnresolvedPathsTo

      public void addUnresolvedPathsTo​(List<Path> list, Pattern pattern, boolean avoidExtensionSplit)
      Adds unresolved-paths to the pattern
      Parameters:
      list - paths to add
      pattern - pattern to add them to
      avoidExtensionSplit - if true, splits will be avoided in file extensions in the paths (defined as anything after the right-most period)
    • addUnresolvedStringsTo

      public void addUnresolvedStringsTo​(List<String> list, Pattern pattern, boolean requiresPeriod)
      Adds unresolved-strings to the pattern
      Parameters:
      list - strings to add
      pattern - pattern to add them to
      requiresPeriod - if true, a constant string will only be trimmed from the right if it includes at least one period (useful to prevent file-extensions) from being broken up.
    • addUnresolvedStringsTo

      public void addUnresolvedStringsTo​(List<String> list, Pattern pattern, boolean requiresPeriod, Skipper skipper)
      Adds unresolved-strings to the pattern with additional instructions to skip certain types of operations (Skipper)
      Parameters:
      list - strings to add
      pattern - pattern to add them to
      requiresPeriod - if true, a constant string will only be trimmed from the right if it includes at least one period (useful to prevent file-extensions) from being broken up.
      skipper - which types of operations to skip