net.sf.qualitycheck.exception
Class IllegalRangeException

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

public class IllegalRangeException
extends RuntimeException

Thrown to indicate that a method has been passed with a range as arguments. A range (start, end, size) is valid if the following conditions are true: - start < size - end < size - start < end

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 arguments are no valid range.
protected static String MESSAGE_WITH_VALUES
          Message to indicate that the the given arguments start, end and size must be a valid range.
 
Constructor Summary
IllegalRangeException()
          Constructs an IllegalRangeException with the default message DEFAULT_MESSAGE.
IllegalRangeException(int start, int end, int size)
          Constructs an IllegalRangeException with the message MESSAGE_WITH_VALUES including the given values of the arguments.
IllegalRangeException(int start, int end, int size, Throwable cause)
          Constructs a new exception with the message MESSAGE_WITH_VALUES including the given values of the arguments.
IllegalRangeException(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 arguments are no valid range.

See Also:
Constant Field Values

MESSAGE_WITH_VALUES

protected static final String MESSAGE_WITH_VALUES
Message to indicate that the the given arguments start, end and size must be a valid range.

See Also:
Constant Field Values
Constructor Detail

IllegalRangeException

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


IllegalRangeException

public IllegalRangeException(int start,
                             int end,
                             int size)
Constructs an IllegalRangeException with the message MESSAGE_WITH_VALUES including the given values of the arguments.

Parameters:
start - the start value of the invalid range
end - the end value of the invalid range
size - the size value of the invalid range

IllegalRangeException

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

Parameters:
start - the start value of the invalid range
end - the end value of the invalid range
size - the size value of the invalid range
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.)

IllegalRangeException

public IllegalRangeException(@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.