edu.rice.cs.drjava.model.compiler
Class CompilerErrorModel

java.lang.Object
  |
  +--edu.rice.cs.drjava.model.compiler.CompilerErrorModel

public class CompilerErrorModel
extends Object

Contains the CompilerErrors for a particular file after a compile has ended.

Version:
$Id: CompilerErrorModel.java,v 1.5 2002/09/02 21:24:11 csreis Exp $

Field Summary
private  Document _document
           
private  CompilerError[] _errors
           
private  CompilerError[] _errorsWithoutPositions
           
private  File _file
           
private  Position[] _positions
           
 
Constructor Summary
CompilerErrorModel()
          Constructs a CompilerErrorModel with no errors or files.
CompilerErrorModel(CompilerError[] errors, Document doc, File file)
          Constructs a new CompilerErrorModel to be maintained by a particular OpenDefinitionsDocument.
 
Method Summary
private  void _createPositionsArray()
          Create array of positions where each error occurred.
private  void _groupErrors(CompilerError[] errors)
          Groups errors into those with and without positions, and creates the corresponding array of positions.
 Document getDocument()
          Returns the document associated with this error model.
 CompilerError[] getErrorsWithoutPositions()
          Returns the array of errors without positions.
 CompilerError[] getErrorsWithPositions()
          Returns the array of errors with positions.
 File getFile()
          Returns the File associated with this error model.
 Position[] getPositions()
          Returns the array of positions.
 String toString()
          Prints out this model's errors.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

_errors

private CompilerError[] _errors

_errorsWithoutPositions

private CompilerError[] _errorsWithoutPositions

_positions

private Position[] _positions

_document

private Document _document

_file

private File _file
Constructor Detail

CompilerErrorModel

public CompilerErrorModel(CompilerError[] errors,
                          Document doc,
                          File file)
Constructs a new CompilerErrorModel to be maintained by a particular OpenDefinitionsDocument.
Parameters:
doc - Document containing the errors
file - File containing the errors, or null

CompilerErrorModel

public CompilerErrorModel()
Constructs a CompilerErrorModel with no errors or files.
Method Detail

getErrorsWithPositions

public CompilerError[] getErrorsWithPositions()
Returns the array of errors with positions.

getErrorsWithoutPositions

public CompilerError[] getErrorsWithoutPositions()
Returns the array of errors without positions.

getPositions

public Position[] getPositions()
Returns the array of positions.

getDocument

public Document getDocument()
Returns the document associated with this error model.

getFile

public File getFile()
Returns the File associated with this error model.

_groupErrors

private void _groupErrors(CompilerError[] errors)
Groups errors into those with and without positions, and creates the corresponding array of positions.

_createPositionsArray

private void _createPositionsArray()
Create array of positions where each error occurred.

toString

public String toString()
Prints out this model's errors.
Overrides:
toString in class Object