|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cs132.util.Problem
public final class Problem
Used to describe a "problem", while referring to some kind of source code. Consists of a "primary" location as well as any number of additional locations.
For example, for a problem like "unknown variable", you'd probably just have a primary location that refers to the variable reference and a message that says "unknown variable".
For something like "duplicate variable name", you might have a primary location that refers to the declaration and a message that says "duplicate variable name" along with an additional location that points to the original declaration of that name with a message like "original declaration".
Nested Class Summary | |
---|---|
static class |
Problem.Ref
A pairing of a SourcePos and a message. |
Field Summary | |
---|---|
List<Problem.Ref> |
additional
Any number of additional locations and messages. |
Problem.Ref |
primary
The primary location and primary error message. |
Constructor Summary | |
---|---|
Problem(Problem.Ref primary)
|
|
Problem(Problem.Ref primary,
List<Problem.Ref> additional)
|
|
Problem(SourcePos sourcePos,
String message)
Convenience constructor that creates a Problem with just a
primary reference. |
|
Problem(SourcePos sourcePos,
String message,
SourcePos additionalSourcePos,
String additionalMessage)
Convenience constructor that creates a Problem with a primary
reference and one additional reference. |
Method Summary | |
---|---|
String |
toString()
|
void |
toString(StringBuilder buf)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final Problem.Ref primary
public final List<Problem.Ref> additional
Constructor Detail |
---|
public Problem(Problem.Ref primary, List<Problem.Ref> additional)
public Problem(Problem.Ref primary)
public Problem(SourcePos sourcePos, String message)
Problem
with just a
primary reference.
public Problem(SourcePos sourcePos, String message, SourcePos additionalSourcePos, String additionalMessage)
Problem
with a primary
reference and one additional reference.
Method Detail |
---|
public String toString()
toString
in class Object
public void toString(StringBuilder buf)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |