options = new ConnectionOptionsCollection();
zoomConnection = yaz4jlib.ZOOM_connection_create(options.zoomOptions);
+ //remove
SWIGTYPE_p_p_char cp = null;
SWIGTYPE_p_p_char addinfo = null;
int errorCode = yaz4jlib.ZOOM_connection_error(zoomConnection, cp, addinfo);
private SWIGTYPE_p_ZOOM_resultset_p resultSet;
private SWIGTYPE_p_ZOOM_connection_p connection;
private long size = 0;
- private Record[] records = null;
private boolean disposed = false;
ResultSet(SWIGTYPE_p_ZOOM_resultset_p resultSet, SWIGTYPE_p_ZOOM_connection_p connection) {
this.resultSet = resultSet;
this.connection = connection;
size = yaz4jlib.ZOOM_resultset_size(this.resultSet);
- records = new Record[(int) size];
}
+ @Override
public void finalize() {
- this.dispose();
+ this._dispose();
}
ResultSetOptionsCollection getResultSetOptions() {
}
public Record getRecord(int index) {
- if (records[index] == null) {
- SWIGTYPE_p_ZOOM_record_p recordTemp = yaz4jlib.ZOOM_resultset_record(resultSet, index);
- records[index] = new Record(recordTemp, this);
- }
-
- return this.records[index];
+ SWIGTYPE_p_ZOOM_record_p recordTemp = yaz4jlib.ZOOM_resultset_record(resultSet, index);
+ return new Record(recordTemp, this);
}
- public int getSize() {
- return (int) size;
+ public long getSize() {
+ return size;
}
- public void dispose() {
+ void _dispose() {
if (!disposed) {
- for (int i = 0; i < records.length; i++) {
- if (records[i] != null) {
- records[i].dispose();
- }
- }
yaz4jlib.ZOOM_resultset_destroy(resultSet);
connection = null;
resultSet = null;
PrefixQuery query = new PrefixQuery("@attr 1=4 \"pottering\"");
ResultSet results = conn.search(query);
- int resultsSize = results.getSize();
+ long resultsSize = results.getSize();
System.out.println("Found " + resultsSize + " records");
for (int i = 0; i < resultsSize; i++) {