Class Skipper

Object
com.owenfeehan.pathpatternfinder.patternelements.unresolved.Skipper

public class Skipper
extends Object
Skips certain kind of resolves operations if it is known a priori that they are unneeded.

If we already know certain operations will fail, as they've been tried before, then they can be deliberately skipped to save computation. This class specifies flags for these operations that can be skipped.

Author:
Owen Feehan
  • Constructor Summary

    Constructors 
    Constructor Description
    Skipper()
    Creates with default values (include everything, and #getStartSplitCharIndex() of 0).
    Skipper​(boolean includeLeftResolve, boolean includeRightResolve, int startSplitCharIndex)
    Creates with explicit values for flags.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(Object obj)  
    int getStartSplitCharIndex()
    The minimum index from which we start attempting to split characters, to avoid repeating.
    int hashCode()  
    boolean includeLeftResolve()
    Whether to try to resolve from the left.
    boolean includeRightResolve()
    Whether to try to resolve from the right.
    void swapResolves()
    Switch whether to resolve from the left, with whether to resolve from the right.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Skipper

      public Skipper()
      Creates with default values (include everything, and #getStartSplitCharIndex() of 0).
    • Skipper

      public Skipper​(boolean includeLeftResolve, boolean includeRightResolve, int startSplitCharIndex)
      Creates with explicit values for flags.
      Parameters:
      includeLeftResolve - whether to try to resolve from the left. We can disable this operation, if we've already tried without success, and don't wish to repeat needlessly.
      includeRightResolve - whether to try to resolve from the right. We can disable this operation, if we've already tried without success, and don't wish to repeat needlessly.
      startSplitCharIndex - the minimum index from which we start attempting to split characters, to avoid repeating
  • Method Details

    • includeLeftResolve

      public boolean includeLeftResolve()
      Whether to try to resolve from the left. We can disable this operation, if we've already tried without success, and don't wish to repeat needlessly.
      Returns:
      true if resolution should be tried, false if it should not be.
    • includeRightResolve

      public boolean includeRightResolve()
      Whether to try to resolve from the right. We can disable this operation, if we've already tried without success, and don't wish to repeat needlessly.
      Returns:
      true if resolution should be tried, false if it should not be.
    • getStartSplitCharIndex

      public int getStartSplitCharIndex()
      The minimum index from which we start attempting to split characters, to avoid repeating.
      Returns:
      the index
    • swapResolves

      public void swapResolves()
      Switch whether to resolve from the left, with whether to resolve from the right.
    • equals

      public boolean equals​(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object