Class NameElementRange


public class NameElementRange
extends DerivePath
Constructs a Path from a sub-range of the name-elements of the Path.

The name-elements are a split of the Path by the directory-separator. See the Path Javadoc.

All indices begin at 0 (for the first element), and can also accept negative-indices which count backwards from the end.

e.g. -1 is the last element; -2 is the second-last element.

Author:
Owen Feehan
  • Constructor Details

  • Method Details

    • checkMisconfigured

      public void checkMisconfigured​(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException
      Overrides:
      checkMisconfigured in class AnchorBean<DerivePath>
      Throws:
      BeanMisconfiguredException
    • deriveFrom

      public Path deriveFrom​(Path source, boolean debugMode) throws DerivePathException
      Description copied from class: DerivePath
      Derives a new path from an existing path.
      Specified by:
      deriveFrom in class DerivePath
      Parameters:
      source - the path to derive from.
      debugMode - true if debug-mode is activated
      Returns:
      the derived path.
      Throws:
      DerivePathException - if anything goes wrong
    • getIndexStart

      public int getIndexStart()
      The index of the first element (inclusive) for the range.

      Zero-indexed. It can be negative, in which it counts backwards from the end. See class description.

    • setIndexStart

      public void setIndexStart​(int indexStart)
      The index of the first element (inclusive) for the range.

      Zero-indexed. It can be negative, in which it counts backwards from the end. See class description.

    • getIndexEnd

      public int getIndexEnd()
      The index of the last element (inclusive) for the range.

      Zero-indexed. It can be negative, in which it counts backwards from the end. See class description.

    • setIndexEnd

      public void setIndexEnd​(int indexEnd)
      The index of the last element (inclusive) for the range.

      Zero-indexed. It can be negative, in which it counts backwards from the end. See class description.