Package one.microstream.exceptions
Class IndexBoundsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IndexOutOfBoundsException
one.microstream.exceptions.IndexBoundsException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ArrayCapacityException
public class IndexBoundsException extends IndexOutOfBoundsException
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description IndexBoundsException(long indexBound)
IndexBoundsException(long indexBound, long index)
IndexBoundsException(long startIndex, long indexBound, long index)
IndexBoundsException(long startIndex, long indexBound, long index, String message)
IndexBoundsException(long indexBound, long index, String message)
IndexBoundsException(long indexBound, String message)
-
Method Summary
Modifier and Type Method Description String
assembleDetailString()
protected String
assembleExplicitMessageAddon()
String
assembleOutputString()
String
getMessage()
Returns an assembled output String due to bad method design inThrowable
.long
index()
The index value used in the accessing attempt causing this exception.long
indexBound()
String
message()
Sadly, the Throwable implementation uses #getMessage() directly to print the exception.static String
messageBody()
long
startIndex()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
IndexBoundsException
public IndexBoundsException(long indexBound) -
IndexBoundsException
-
IndexBoundsException
public IndexBoundsException(long indexBound, long index) -
IndexBoundsException
-
IndexBoundsException
public IndexBoundsException(long startIndex, long indexBound, long index) -
IndexBoundsException
-
-
Method Details
-
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.
- Returns:
- index value used in the accessing attempt causing this exception
-
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 an 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
-
assembleExplicitMessageAddon
-
assembleOutputString
-
getMessage
Returns an assembled output String due to bad method design inThrowable
. 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, seemessage()
.- Overrides:
getMessage
in classThrowable
- Returns:
- this exception type's generic message plus an explicit message if present.
-