|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.compiler.CompilerErrorModel
public class CompilerErrorModel
Contains the CompilerErrors for a set of compiled file after a compile has ended.
| Nested Class Summary | |
|---|---|
private static class |
CompilerErrorModel.StartAndEndIndex
This class is used only to track where the errors with positions for a file begin and end. |
| Field Summary | |
|---|---|
private DJError[] |
_errors
An array of errors to be displayed in the CompilerErrorPanel associated with this model. |
private java.util.HashMap<java.io.File,CompilerErrorModel.StartAndEndIndex> |
_filesToIndexes
Used internally in building _positions. |
private GlobalModel |
_model
The global model which created/controls this object. |
private int |
_numCompilerErrors
The number of compile errors. |
private int |
_numErrors
The size of _errors and _positions. |
private int |
_numWarnings
The number of compile warnings. |
private int |
_onlyWarnings
Cached result of hasOnlyWarnings. |
private javax.swing.text.Position[] |
_positions
An array of file offsets, parallel to the _errors array. |
private static java.lang.String |
newLine
|
| Constructor Summary | |
|---|---|
CompilerErrorModel()
Constructs an empty CompilerErrorModel with no errors and a dummy global model. |
|
CompilerErrorModel(DJError[] errors,
GlobalModel model)
Constructs a new CompilerErrorModel with specified global model. |
|
| Method Summary | |
|---|---|
private void |
_calculatePositions()
Create array of positions where each error occurred. |
DJError |
getError(int idx)
Accessor for errors maintained here. |
DJError |
getErrorAtOffset(OpenDefinitionsDocument odd,
int offset)
This method finds and returns the error that is at the given offset |
int |
getNumCompErrors()
Returns the number of CompilerErrors that are compiler errors |
int |
getNumErrors()
Returns the number of CompilerErrors. |
int |
getNumWarnings()
Returns the number of CompilerErrors that are warnings |
javax.swing.text.Position |
getPosition(DJError error)
Returns the position of the given error in the document representing its file. |
boolean |
hasErrorsWithPositions(OpenDefinitionsDocument odd)
This function tells if there are errors with source locations associated with the given file. |
boolean |
hasOnlyWarnings()
Checks whether all CompilerErrors contained here are actually warnings. |
private int |
nextErrorWithLine(int idx)
Finds the first error after numProcessed which has a file and line number. |
java.lang.String |
toString()
Prints out this model's errors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String newLine
private final DJError[] _errors
private final javax.swing.text.Position[] _positions
private final int _numErrors
private volatile int _numCompilerErrors
private volatile int _numWarnings
private volatile int _onlyWarnings
private final java.util.HashMap<java.io.File,CompilerErrorModel.StartAndEndIndex> _filesToIndexes
private final GlobalModel _model
| Constructor Detail |
|---|
public CompilerErrorModel()
public CompilerErrorModel(DJError[] errors,
GlobalModel model)
errors - the list of DJError's (or a subclass).model - is the model to find documents from| Method Detail |
|---|
public DJError getError(int idx)
idx - the index of the error to retrieve
java.lang.NullPointerException - if this object was improperly initialized
java.lang.ArrayIndexOutOfBoundsException - if !(0 <= idx < this.getNumErrors())public javax.swing.text.Position getPosition(DJError error)
public int getNumErrors()
public int getNumCompErrors()
public int getNumWarnings()
public java.lang.String toString()
toString in class java.lang.Object
public DJError getErrorAtOffset(OpenDefinitionsDocument odd,
int offset)
odd - the OpenDefinitionsDocument where you want to find the error at the caretoffset - the offset into the document
public boolean hasErrorsWithPositions(OpenDefinitionsDocument odd)
public boolean hasOnlyWarnings()
private void _calculatePositions()
private int nextErrorWithLine(int idx)
idx - the starting index of the search
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||