Package com.tonic.analysis.verifier
Class ErrorCollector.CollectAllCollector
- java.lang.Object
-
- com.tonic.analysis.verifier.ErrorCollector.CollectAllCollector
-
- All Implemented Interfaces:
ErrorCollector
- Enclosing interface:
- ErrorCollector
public static final class ErrorCollector.CollectAllCollector extends Object implements ErrorCollector
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tonic.analysis.verifier.ErrorCollector
ErrorCollector.CollectAllCollector, ErrorCollector.FailFastCollector
-
-
Constructor Summary
Constructors Constructor Description CollectAllCollector(int maxErrors)Creates a collector retaining at most the given number of errors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddError(VerificationError error)Records the error unless the cap has already been reached.voidaddWarning(VerificationError warning)Records a warning; warnings are not capped.List<VerificationError>getErrors()List<VerificationError>getWarnings()booleanhasErrors()booleanhasWarnings()voidreset()Clears every recorded error and warning.booleanshouldStop()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tonic.analysis.verifier.ErrorCollector
add
-
-
-
-
Method Detail
-
addError
public void addError(VerificationError error)
Records the error unless the cap has already been reached.- Specified by:
addErrorin interfaceErrorCollector- Parameters:
error- the error to record
-
addWarning
public void addWarning(VerificationError warning)
Records a warning; warnings are not capped.- Specified by:
addWarningin interfaceErrorCollector- Parameters:
warning- the warning to record
-
getErrors
public List<VerificationError> getErrors()
- Specified by:
getErrorsin interfaceErrorCollector- Returns:
- the recorded errors, unmodifiable
-
getWarnings
public List<VerificationError> getWarnings()
- Specified by:
getWarningsin interfaceErrorCollector- Returns:
- the recorded warnings, unmodifiable
-
hasErrors
public boolean hasErrors()
- Specified by:
hasErrorsin interfaceErrorCollector- Returns:
- true when at least one error has been recorded
-
hasWarnings
public boolean hasWarnings()
- Specified by:
hasWarningsin interfaceErrorCollector- Returns:
- true when at least one warning has been recorded
-
shouldStop
public boolean shouldStop()
- Specified by:
shouldStopin interfaceErrorCollector- Returns:
- true once the error cap has been reached
-
reset
public void reset()
Clears every recorded error and warning.- Specified by:
resetin interfaceErrorCollector
-
-