1 /******************************************************************************
2  * $Id: gnm_java.i 19f708c8a21ace821b243cbb6833e12dffcb82b3 2018-01-08 19:18:49Z Even Rouault $
3  *
4  * Project:  GNM Core SWIG Interface declarations.
5  * Purpose:  GNM declarations.
6  * Authors:  Mikhail Gusev (gusevmihs at gmail dot com)
7  *           Dmitry Baryshnikov, polimax@mail.ru
8  *
9  ******************************************************************************
10  * Copyright (c) 2016, Dmitry Baryshnikov
11  * Copyright (c) 2016, NextGIS <info@nextgis.com>
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  *****************************************************************************/
31 
32 #ifndef FROM_GDAL_I
33 %include java_exceptions.i
34 #endif
35 
36 %pragma(java) jniclasscode=%{
37 
38   static {
39     gdalJNI.isAvailable();   // force gdalJNI static initializer to run and load library
40   }
41 
isAvailable()42   public static boolean isAvailable() {
43     return gdalJNI.isAvailable();
44   }
45 %}
46 
47 %pragma(java) jniclassimports=%{
48 import org.gdal.osr.SpatialReference;
49 import org.gdal.osr.CoordinateTransformation;
50 import org.gdal.gdal.MajorObject;
51 import org.gdal.ogr.Geometry;
52 import org.gdal.ogr.Feature;
53 import org.gdal.ogr.StyleTable;
54 import org.gdal.ogr.Layer;
55 import org.gdal.gdal.gdalJNI;
56 %}
57 
58 %pragma(java) moduleimports=%{
59 import org.gdal.osr.SpatialReference;
60 import org.gdal.gdal.MajorObject;
61 import org.gdal.ogr.Geometry;
62 import org.gdal.ogr.Feature;
63 import org.gdal.ogr.StyleTable;
64 import org.gdal.ogr.Layer;
65 %}
66 
67 %typemap(javaimports) GNMNetworkShadow %{
68 import org.gdal.osr.SpatialReference;
69 import org.gdal.gdal.MajorObject;
70 import org.gdal.ogr.Geometry;
71 import org.gdal.ogr.Feature;
72 import org.gdal.ogr.StyleTable;
73 import org.gdal.ogr.Layer;
74 %}
75 
76 %typemap(javaimports) GNMGenericNetworkShadow %{
77 import org.gdal.osr.SpatialReference;
78 import org.gdal.gdal.MajorObject;
79 import org.gdal.ogr.Geometry;
80 import org.gdal.ogr.Feature;
81 import org.gdal.ogr.StyleTable;
82 import org.gdal.ogr.Layer;
83 %}
84 
85 %typemap(javacode) GNMNetworkShadow %{
86 
equals(Object obj)87   public boolean equals(Object obj) {
88     boolean equal = false;
89     if (obj instanceof $javaclassname)
90       equal = ((($javaclassname)obj).swigCPtr == this.swigCPtr);
91     return equal;
92   }
93 
hashCode()94   public int hashCode() {
95      return (int)swigCPtr;
96   }
97 %}
98 
99 %typemap(javacode) GNMGenericNetworkShadow %{
100 
equals(Object obj)101   public boolean equals(Object obj) {
102     boolean equal = false;
103     if (obj instanceof $javaclassname)
104       equal = ((($javaclassname)obj).swigCPtr == this.swigCPtr);
105     return equal;
106   }
107 
hashCode()108   public int hashCode() {
109      return (int)swigCPtr;
110   }
111 %}
112 
113 #ifndef FROM_GDAL_I
114 %include callback.i
115 #endif
116 
117 %include typemaps_java.i
118