| java.lang.Object org.incava.analysis.Violation
Violation | public class Violation implements Comparable(Code) | | An error or a warning, associated with a file by a starting and ending
position, and a message.
|
Constructor Summary | |
public | Violation(String message, int beginLine, int beginColumn, int endLine, int endColumn) Creates a violation from a message and begin and end positions. | public | Violation(String message, Token beginToken, Token endToken) Creates a violation from a message and beginning and ending token. | public | Violation(String message, Token token) Creates a violation from a message and a token. |
Method Summary | |
public int | compareTo(Object obj) Compares this violation to another. | public boolean | equals(Object obj) Returns whether the other object is equal to this one. | public int | getBeginColumn() Returns the column where the violation starts. | public int | getBeginLine() Returns the line where the violation starts. | public int | getEndColumn() Returns the column where the violation ends. | public int | getEndLine() Returns the line where the violation ends. | public String | getMessage() Returns the message for this violation. | public String | toString() Returns this violation, as a string. |
Violation | public Violation(String message, int beginLine, int beginColumn, int endLine, int endColumn)(Code) | | Creates a violation from a message and begin and end positions.
Parameters: message - The message applying to this violation. Parameters: beginLine - The line where the violation begins. Parameters: beginColumn - The column where the violation begins. Parameters: endLine - The line where the violation ends. Parameters: endColumn - The column where the violation ends. |
Violation | public Violation(String message, Token beginToken, Token endToken)(Code) | | Creates a violation from a message and beginning and ending token.
Parameters: message - The message applying to this violation. Parameters: beginToken - The token where the violation begins. Parameters: endToken - The token where the violation ends. |
Violation | public Violation(String message, Token token)(Code) | | Creates a violation from a message and a token. The token image is
considered to be the entire length of the violation, i.e., the ending
location is token + token.image.length() - 1 .
Parameters: message - The message applying to this violation. Parameters: token - The token to which the violation applies. |
compareTo | public int compareTo(Object obj)(Code) | | Compares this violation to another. Violations are sorted in order by
their beginning locations, then their end locations.
Parameters: obj - The violation to compare this to. -1, 0, or 1, for less than, equivalent to, or greater than. |
equals | public boolean equals(Object obj)(Code) | | Returns whether the other object is equal to this one. Note that messages
are not compared, only line and column numbers.
Parameters: obj - The violation to compare this to. Whether the other violation is equal to this one. |
getBeginColumn | public int getBeginColumn()(Code) | | Returns the column where the violation starts.
|
getBeginLine | public int getBeginLine()(Code) | | Returns the line where the violation starts.
|
getEndColumn | public int getEndColumn()(Code) | | Returns the column where the violation ends.
|
getEndLine | public int getEndLine()(Code) | | Returns the line where the violation ends.
|
getMessage | public String getMessage()(Code) | | Returns the message for this violation. This should be only one line,
because it is used in single-line reports.
|
toString | public String toString()(Code) | | Returns this violation, as a string.
This violation, as a string. |
|
|