public class Violation
extends java.lang.Object
implements java.lang.Comparable
Constructor and Description |
---|
Violation(java.lang.String message,
int beginLine,
int beginColumn,
int endLine,
int endColumn)
Creates a violation from a message and begin and end positions.
|
Violation(java.lang.String message,
Token token)
Creates a violation from a message and a token.
|
Violation(java.lang.String message,
Token beginToken,
Token endToken)
Creates a violation from a message and beginning and ending token.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object obj)
Compares this violation to another.
|
boolean |
equals(java.lang.Object obj)
Returns whether the other object is equal to this one.
|
int |
getBeginColumn()
Returns the column where the violation starts.
|
int |
getBeginLine()
Returns the line where the violation starts.
|
int |
getEndColumn()
Returns the column where the violation ends.
|
int |
getEndLine()
Returns the line where the violation ends.
|
java.lang.String |
getMessage()
Returns the message for this violation.
|
java.lang.String |
toString()
Returns this violation, as a string.
|
public Violation(java.lang.String message, int beginLine, int beginColumn, int endLine, int endColumn)
message
- The message applying to this violation.beginLine
- The line where the violation begins.beginColumn
- The column where the violation begins.endLine
- The line where the violation ends.endColumn
- The column where the violation ends.public Violation(java.lang.String message, Token beginToken, Token endToken)
message
- The message applying to this violation.beginToken
- The token where the violation begins.endToken
- The token where the violation ends.public Violation(java.lang.String message, Token token)
token + token.image.length() - 1
.message
- The message applying to this violation.token
- The token to which the violation applies.public java.lang.String getMessage()
public int getBeginLine()
public int getBeginColumn()
public int getEndLine()
public int getEndColumn()
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
obj
- The violation to compare this to.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The violation to compare this to.public java.lang.String toString()
toString
in class java.lang.Object