cs132.util
Class ProblemException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by cs132.util.ProblemException
All Implemented Interfaces:
Serializable

public class ProblemException
extends Exception

An exception that has a List of Problem objects.

See Also:
Serialized Form

Field Summary
 List<Problem> problems
          The list of problems.
 
Constructor Summary
ProblemException(Iterable<Problem> problems)
           
ProblemException(Problem problem)
           
 
Method Summary
 String getMessage()
           
static ProblemException pex(SourcePos sourcePos, String message)
          Convenience method that greates a Problem with the given position and message, then wraps it in an exception and returns it.
static ProblemException pex(SourcePos sourcePos, String message, SourcePos l2, String m2)
          Convenience method that greates a Problem with the given positions and messages, then wraps it in an exception and returns it.
 
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

problems

public final List<Problem> problems
The list of problems. Guaranteed to have at least one.

Constructor Detail

ProblemException

public ProblemException(Problem problem)

ProblemException

public ProblemException(Iterable<Problem> problems)
Method Detail

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable

pex

public static ProblemException pex(SourcePos sourcePos,
                                   String message)
Convenience method that greates a Problem with the given position and message, then wraps it in an exception and returns it.


pex

public static ProblemException pex(SourcePos sourcePos,
                                   String message,
                                   SourcePos l2,
                                   String m2)
Convenience method that greates a Problem with the given positions and messages, then wraps it in an exception and returns it.