Class IndexBoundsException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ArrayCapacityException

public class IndexBoundsException
extends IndexOutOfBoundsException
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • messageBody

      public static final String messageBody()
    • startIndex

      public final long startIndex()
    • indexBound

      public final long indexBound()
    • index

      public final long index()
      The index value used in the accessing attempt causing this exception.

      Note that this value might have overflown depending on the reporting logic.

    • message

      public final String message()
      Sadly, the Throwable implementation uses #getMessage() directly to print the exception. This is a concern conflict: getMessage should actually be the getter for the explicit message. But it is used as the String assembling method as well. So a output method generically assembling the output string must override the getter. As this hides the actual getting functionality, a workaround accessor method has to be provided for potential subclasses.
      Returns:
      the explicit message string passed to the constructor when creating this instance.
    • assembleDetailString

      public String assembleDetailString()
    • assembleExplicitMessageAddon

      protected String assembleExplicitMessageAddon()
    • assembleOutputString

      public String assembleOutputString()
    • getMessage

      public String getMessage()
      Returns an assembled output String due to bad method design in Throwable. Albeit being named "getMessage" by the JDK developers, this method should be seen as "assembleOutputString" as this is its purpose. For the actual message getter, see message().
      Overrides:
      getMessage in class Throwable
      Returns:
      this exception type's generic message plus an explicit message if present.