Class ZeroBasedIndexRange

java.lang.Object
com.jfcbuilder.types.ZeroBasedIndexRange

public class ZeroBasedIndexRange extends Object
Represents a range of container elements by defining both a start and end zero-based index.
  • Constructor Details

    • ZeroBasedIndexRange

      public ZeroBasedIndexRange()
      Constructor.
    • ZeroBasedIndexRange

      public ZeroBasedIndexRange(int startIndex, int endIndex) throws IllegalArgumentException
      Constructor that sets the zero-based indexes defining the range.
      Parameters:
      startIndex - Zero based index of the start of the range
      endIndex - 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

      public void set(int startIndex, int endIndex) throws IllegalArgumentException
      Sets the zero-based indexes defining the range.
      Parameters:
      startIndex - Zero based index of the start of the range
      endIndex - 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

      public String toString()
      Overrides:
      toString in class Object