Reformat (NetBeans).
[yaz4j-moved-to-github.git] / src / main / java / org / yaz4j / Package.java
1 package org.yaz4j;
2
3 import org.yaz4j.jni.SWIGTYPE_p_ZOOM_package_p;
4 import org.yaz4j.jni.yaz4jlib;
5
6 public class Package {
7
8     private SWIGTYPE_p_ZOOM_package_p pack = null;
9     private ConnectionExtended connection = null;
10     private String type;
11
12     Package(SWIGTYPE_p_ZOOM_package_p pack, ConnectionExtended connection, String type) {
13         this.type = type;
14         this.connection = connection;
15         this.pack = pack;
16     }
17
18     public void finalize() {
19         Dispose();
20     }
21
22     public PackageOptionsCollection getPackageOptions() {
23         return new PackageOptionsCollection(pack);
24     }
25
26     public void Send() {
27         yaz4jlib.ZOOM_package_send(pack, type);
28     }
29
30     public void Dispose() {
31         if (pack != null) {
32             yaz4jlib.ZOOM_package_destroy(pack);
33             connection = null;
34             pack = null;
35         }
36     }
37 }