net.sf.qualitycheck.exception
Class IllegalPositionIndexException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.sf.qualitycheck.exception.IllegalPositionIndexException
All Implemented Interfaces:
Serializable

public class IllegalPositionIndexException
extends RuntimeException

Thrown to indicate that a passed position index was out of the bounds of a string, list, array ... .

Author:
André Rouél, Dominik Seichter
See Also:
Serialized Form

Field Summary
protected static String DEFAULT_MESSAGE
          Default message to indicate that the a given position index is not valid.
protected static String MESSAGE_WITH_VALUES
          Default message to indicate that the a given position index is not valid within the given bounds.
 
Constructor Summary
IllegalPositionIndexException()
          Constructs an IllegalPositionIndexException with the default message DEFAULT_MESSAGE.
IllegalPositionIndexException(int index, int size)
          Constructs an IllegalPositionIndexException with the message MESSAGE_WITH_VALUES including the given values of the arguments.
IllegalPositionIndexException(int index, int size, Throwable cause)
          Constructs a new exception with the message MESSAGE_WITH_VALUES including the given values of the arguments.
IllegalPositionIndexException(Throwable cause)
          Constructs a new exception with the default message DEFAULT_MESSAGE.
 
Method Summary
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MESSAGE

protected static final String DEFAULT_MESSAGE
Default message to indicate that the a given position index is not valid.

See Also:
Constant Field Values

MESSAGE_WITH_VALUES

protected static final String MESSAGE_WITH_VALUES
Default message to indicate that the a given position index is not valid within the given bounds.

See Also:
Constant Field Values
Constructor Detail

IllegalPositionIndexException

public IllegalPositionIndexException()
Constructs an IllegalPositionIndexException with the default message DEFAULT_MESSAGE.


IllegalPositionIndexException

public IllegalPositionIndexException(int index,
                                     int size)
Constructs an IllegalPositionIndexException with the message MESSAGE_WITH_VALUES including the given values of the arguments.

Parameters:
index - an index in an array, list or string
size - the size of an array, list or string

IllegalPositionIndexException

public IllegalPositionIndexException(int index,
                                     int size,
                                     @Nullable
                                     Throwable cause)
Constructs a new exception with the message MESSAGE_WITH_VALUES including the given values of the arguments.

Parameters:
index - an index in an array, list or string
size - the size of an array, list or string
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

IllegalPositionIndexException

public IllegalPositionIndexException(@Nullable
                                     Throwable cause)
Constructs a new exception with the default message DEFAULT_MESSAGE.

Parameters:
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)


Copyright © 2012-2013. All Rights Reserved.