public class ErrorChecker
extends java.lang.Object
implements java.lang.Cloneable
This project was carried out at:
and supported byGenOpt Copyright (c) 1998-2021, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
errInd
Array with error messages that may be written by the simulation program.
|
private static java.lang.String |
LS
System dependent line separator
|
protected int |
nErr
Number of error messages.
|
Constructor and Description |
---|
ErrorChecker()
Constructor.
|
ErrorChecker(java.lang.String[] ErrorIndicator)
Constructor that assigns the strings of error messages that may be written
by the simulation program in case the simulation terminates with an error.
|
Modifier and Type | Method and Description |
---|---|
java.util.Vector<java.lang.String> |
check(java.lang.String fileName,
java.lang.String AdditionalErrorInformation)
Checks the argument for possible error messages.
|
protected java.lang.Object |
clone()
Clones the object.
|
java.lang.String |
getErrorString(int Position)
Gets a single possible error string.
|
int |
getNumberOfErrors()
Gets the number of possible error strings.
|
static void |
main(java.lang.String[] args)
The main method.
|
private static final java.lang.String LS
protected java.lang.String[] errInd
protected int nErr
public ErrorChecker()
public ErrorChecker(java.lang.String[] ErrorIndicator)
ErrorIndicator
- Array of strings that contain all messages
that are written to a log file by the simulation program
in case of an error.protected java.lang.Object clone()
clone
in class java.lang.Object
public java.util.Vector<java.lang.String> check(java.lang.String fileName, java.lang.String AdditionalErrorInformation) throws java.io.IOException
StringToCheck
for
any error messages. If no errors are found, it returns
an empty Vector. Otherwise, a Vector with all
found errors and an additional error information as the first entry are returned.fileName
- Name of file that has to be checked for errorsAdditionalErrorInformation
- Additional string that is added at the beginning
of the returned the error messagejava.io.IOException
- if the file cannot be readpublic int getNumberOfErrors()
ErrorChecker(String[] ErrorIndicator)
and not the number of found error strings passed by
check(String StringToCheck, String AdditionalErrorInformation)
.public java.lang.String getErrorString(int Position)
ErrorChecker(String[] ErrorIndicator)
and not the number of found error Strings passed by
check(String StringToCheck, String AdditionalErrorInformation)
.Position
- 0-based index of error stringpublic static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException