Class IndexRangeNegativeFactory

Object
IndexRangeNegativeFactory

public class IndexRangeNegativeFactory extends Object
Author:
Owen Feehan
  • Method Details

    • parse

      public static IndexRangeNegative parse(String str) throws OperationFailedException
      Parses a string to convert it into an IndexRangeNegative.

      The string should be in any of the following formats:

      • start:end
      • single_index
      • :end
      • start:
      where
      • start is a positive or negative integer indicating the start index of the range (where 0 is the first element).
      • end is a positive or negative integer indicating the end index of the range (inclusive, where either -1 or length(array) - 1 is the last element).
      • single_index implies the same value for both start and end.
      Parameters:
      str - the string to parse
      Returns:
      the range extracted from the parsed string
      Throws:
      OperationFailedException - if the string does not match any of the patterns above.