forked from s-u/REngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
REngineEvalException.java
59 lines (51 loc) · 1.23 KB
/
REngineEvalException.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package org.rosuda.REngine ;
/**
* Exception thrown when an error occurs during eval.
*
* <p>
* This class is a placeholder and should be extended when more information
* can be extracted from R (call stack, etc ... )
* </p>
*/
public class REngineEvalException extends REngineException {
/**
* Value returned by the rniEval native method when the input passed to eval
* is invalid
*/
public static final int INVALID_INPUT = -1 ;
/**
* Value returned by the rniEval native method when an error occured during
* eval (stop, ...)
*/
public static final int ERROR = -2 ;
/**
* Type of eval error
*/
protected int type ;
/**
* Constructor
*
* @param eng associated REngine
* @param message error message
* @param type type of error (ERROR or INVALID_INPUT)
*/
public REngineEvalException( REngine eng, String message, int type ){
super( eng, message );
this.type = type ;
}
/**
* Constructor using ERROR type
*
* @param eng associated REngine
* @param message error message
*/
public REngineEvalException( REngine eng, String message){
this( eng, message, ERROR );
}
/**
* @return the type of error (ERROR or INVALID_INPUT)
*/
public int getType(){
return type ;
}
}