Class IndexRangeNegativeFactory
Object
IndexRangeNegativeFactory
Creates
IndexRangeNegative
.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic IndexRangeNegative
Parses a string to convert it into anIndexRangeNegative
.
-
Method Details
-
parse
Parses a string to convert it into anIndexRangeNegative
.The string should be in any of the following formats:
start:end
single_index
:end
start:
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 bothstart
andend
.
- 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.
-