Package com.jfcbuilder.types
Class ZeroBasedIndexRange
java.lang.Object
com.jfcbuilder.types.ZeroBasedIndexRange
Represents a range of container elements by defining both a start and end zero-based index.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.ZeroBasedIndexRange
(int startIndex, int endIndex) Constructor that sets the zero-based indexes defining the range. -
Method Summary
-
Constructor Details
-
ZeroBasedIndexRange
public ZeroBasedIndexRange()Constructor. -
ZeroBasedIndexRange
Constructor that sets the zero-based indexes defining the range.- Parameters:
startIndex
- Zero based index of the start of the rangeendIndex
- Zero based index of the end of the range- Throws:
IllegalArgumentException
- If startIndex or endIndex are negative, or if startIndex is greater than endIndex.
-
-
Method Details
-
set
Sets the zero-based indexes defining the range.- Parameters:
startIndex
- Zero based index of the start of the rangeendIndex
- Zero based index of the end of the range- Throws:
IllegalArgumentException
- If startIndex or endIndex are negative, or if startIndex is greater than endIndex.
-
getStartIndex
public int getStartIndex()Gets the zero-based start index defining the range.- Returns:
- Zero based start index of the start of the range
-
getEndIndex
public int getEndIndex()Gets the zero-based end index defining the range.- Returns:
- Zero based end index of the start of the range
-
toString
-