-
Notifications
You must be signed in to change notification settings - Fork 1
/
Suite.java
51 lines (44 loc) · 1.16 KB
/
Suite.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
public class Suite {
private long pointer; // Pointer to the coco_suite_t object
private String name;
/**
* Constructs the suite from the given suiteName, suiteInstance and suiteOptions.
* See http://numbbo.github.io/coco-doc/C/#suite-parameters for more information on
* valid suite parameters.
* @param suiteName
* @param suiteInstance
* @param suiteOptions
* @throws Exception
*/
public Suite(String suiteName, String suiteInstance, String suiteOptions) throws Exception {
super();
try {
this.pointer = CocoJNI.cocoGetSuite(suiteName, suiteInstance, suiteOptions);
this.name = suiteName;
} catch (Exception e) {
throw new Exception("Suite constructor failed.\n" + e.toString());
}
}
/**
* Finalizes the suite.
* @throws Exception
*/
public void finalizeSuite() throws Exception {
try {
CocoJNI.cocoFinalizeSuite(this.pointer);
} catch (Exception e) {
throw new Exception("Suite finalization failed.\n" + e.toString());
}
}
public long getPointer() {
return this.pointer;
}
public String getName() {
return this.name;
}
/* toString method */
@Override
public String toString() {
return getName();
}
}