codesimian
Class CountPException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by codesimian.CountPException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CountPException.TooBig, CountPException.TooBig.CouldNotAdd, CountPException.TooSmall, CountPException.TooSmall.CouldNotDelete

public class CountPException
extends java.lang.RuntimeException

Means some CS's countP() is not in a valid range (between minP() and maxP() inclusive).

Obviously countP() must start at 0, but when compiling is done, it should be in the valid range.

Throw a new CountPException() when someCS.countP() < someCS.minP() OR someCS.maxP() < someCS.countP().

A CS is not required to throw a CountPException if it can ignore the error, but if you must throw something, throw a subclass of CountPException.

See Also:
Serialized Form

Nested Class Summary
static class CountPException.TooBig
          thrown when someCS.maxP() < someCS.countP()
static class CountPException.TooSmall
          thrown when someCS.countP() < someCS.minP()
 
Field Summary
 int badCountP
          the countP() when this Exception occured
 CS cs
          the CS whose countP() is out of valid range
 java.lang.String message
           
 
Constructor Summary
CountPException()
           
CountPException(CS myCountPIsOutOfRange)
           
CountPException(CS myCountPIsOutOfRange, java.lang.String message)
           
CountPException(java.lang.String message)
           
 
Method Summary
 java.lang.String getMessage()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

badCountP

public final int badCountP
the countP() when this Exception occured


cs

public final CS cs
the CS whose countP() is out of valid range


message

public final java.lang.String message
Constructor Detail

CountPException

public CountPException()

CountPException

public CountPException(java.lang.String message)

CountPException

public CountPException(CS myCountPIsOutOfRange)

CountPException

public CountPException(CS myCountPIsOutOfRange,
                       java.lang.String message)
Method Detail

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable