1
|
package eu.dnetlib.enabling.resultset;
|
2
|
|
3
|
import javax.xml.bind.annotation.XmlRootElement;
|
4
|
|
5
|
import eu.dnetlib.enabling.resultset.listener.ResultSetListener;
|
6
|
|
7
|
@XmlRootElement
|
8
|
public class ResultSetInfo {
|
9
|
|
10
|
private String id;
|
11
|
private int cursor = -1;
|
12
|
private int total = -1;
|
13
|
private boolean inaccurate = false;
|
14
|
|
15
|
public ResultSetInfo() {}
|
16
|
|
17
|
public ResultSetInfo(final String id, final ResultSetListener<?> listener) {
|
18
|
this.id = id;
|
19
|
this.cursor = listener.getCount();
|
20
|
this.total = listener.getTotal();
|
21
|
this.inaccurate = listener.getCount() < 0 || listener.getTotal() < 0 || listener.getTotal() < listener.getCount();
|
22
|
}
|
23
|
|
24
|
public ResultSetInfo(final String id, final int cursor, final int total, final boolean inaccurate) {
|
25
|
this.id = id;
|
26
|
this.cursor = cursor;
|
27
|
this.total = total;
|
28
|
this.inaccurate = inaccurate;
|
29
|
}
|
30
|
|
31
|
public String getId() {
|
32
|
return this.id;
|
33
|
}
|
34
|
|
35
|
public void setId(final String id) {
|
36
|
this.id = id;
|
37
|
}
|
38
|
|
39
|
public int getTotal() {
|
40
|
return this.total;
|
41
|
}
|
42
|
|
43
|
public void setTotal(final int total) {
|
44
|
this.total = total;
|
45
|
}
|
46
|
|
47
|
public int getCursor() {
|
48
|
return this.cursor;
|
49
|
}
|
50
|
|
51
|
public void setCursor(final int cursor) {
|
52
|
this.cursor = cursor;
|
53
|
}
|
54
|
|
55
|
public boolean isInaccurate() {
|
56
|
return this.inaccurate;
|
57
|
}
|
58
|
|
59
|
public void setInaccurate(final boolean inaccurate) {
|
60
|
this.inaccurate = inaccurate;
|
61
|
}
|
62
|
|
63
|
}
|