Loading...
Searching...
No Matches
Sublocation.java
Go to the documentation of this file.
1package com.navigine.idl.java;
2
3import java.util.ArrayList;
4import java.util.concurrent.atomic.AtomicBoolean;
5
19public abstract class Sublocation {
25 public abstract android.graphics.Bitmap getImage(Integer maxTextureSize);
26
33 public abstract LocationPoint globalToLocal(GlobalPoint globalPoint);
34
41 public abstract GlobalPoint localToGlobal(LocationPoint localPoint);
42
49 public abstract Graph getGraph(String tag);
50
57 public abstract Venue getVenueById(int id);
58
65 public abstract Zone getZoneById(int id);
66
70 public abstract int getId();
71
75 public abstract int getLocation();
76
80 public abstract String getName();
81
85 public abstract float getWidth();
86
90 public abstract float getHeight();
91
95 public abstract Float getAltitude();
96
100 public abstract float getAzimuth();
101
105 public abstract GlobalPoint getOriginPoint();
106
110 public abstract String getLevelId();
111
115 public abstract String getExternalId();
116
120 public abstract ArrayList<Beacon> getBeacons();
121
125 public abstract ArrayList<Eddystone> getEddystones();
126
130 public abstract ArrayList<Wifi> getWifis();
131
135 public abstract ArrayList<ReferencePoint> getReferencePoints();
136
141 public abstract ArrayList<Venue> getVenues();
142
146 public abstract ArrayList<Zone> getZones();
147
148 private static final class CppProxy extends Sublocation
149 {
150 private final long nativeRef;
151 private final AtomicBoolean destroyed = new AtomicBoolean(false);
152
153 private CppProxy(long nativeRef)
154 {
155 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
156 this.nativeRef = nativeRef;
157 }
158
159 private native void nativeDestroy(long nativeRef);
160 public void _djinni_private_destroy()
161 {
162 boolean destroyed = this.destroyed.getAndSet(true);
163 if (!destroyed) nativeDestroy(this.nativeRef);
164 }
165 protected void finalize() throws java.lang.Throwable
166 {
167 _djinni_private_destroy();
168 super.finalize();
169 }
170
171 // Sublocation methods
172
173 @Override
174 public android.graphics.Bitmap getImage(Integer maxTextureSize)
175 {
176 assert !this.destroyed.get() : "trying to use a destroyed object";
177 return native_getImage(this.nativeRef, maxTextureSize);
178 }
179 private native android.graphics.Bitmap native_getImage(long _nativeRef, Integer maxTextureSize);
180
181 @Override
182 public LocationPoint globalToLocal(GlobalPoint globalPoint)
183 {
184 assert !this.destroyed.get() : "trying to use a destroyed object";
185 return native_globalToLocal(this.nativeRef, globalPoint);
186 }
187 private native LocationPoint native_globalToLocal(long _nativeRef, GlobalPoint globalPoint);
188
189 @Override
190 public GlobalPoint localToGlobal(LocationPoint localPoint)
191 {
192 assert !this.destroyed.get() : "trying to use a destroyed object";
193 return native_localToGlobal(this.nativeRef, localPoint);
194 }
195 private native GlobalPoint native_localToGlobal(long _nativeRef, LocationPoint localPoint);
196
197 @Override
198 public Graph getGraph(String tag)
199 {
200 assert !this.destroyed.get() : "trying to use a destroyed object";
201 return native_getGraph(this.nativeRef, tag);
202 }
203 private native Graph native_getGraph(long _nativeRef, String tag);
204
205 @Override
206 public Venue getVenueById(int id)
207 {
208 assert !this.destroyed.get() : "trying to use a destroyed object";
209 return native_getVenueById(this.nativeRef, id);
210 }
211 private native Venue native_getVenueById(long _nativeRef, int id);
212
213 @Override
214 public Zone getZoneById(int id)
215 {
216 assert !this.destroyed.get() : "trying to use a destroyed object";
217 return native_getZoneById(this.nativeRef, id);
218 }
219 private native Zone native_getZoneById(long _nativeRef, int id);
220
221 @Override
222 public int getId()
223 {
224 assert !this.destroyed.get() : "trying to use a destroyed object";
225 return native_getId(this.nativeRef);
226 }
227 private native int native_getId(long _nativeRef);
228
229 @Override
230 public int getLocation()
231 {
232 assert !this.destroyed.get() : "trying to use a destroyed object";
233 return native_getLocation(this.nativeRef);
234 }
235 private native int native_getLocation(long _nativeRef);
236
237 @Override
238 public String getName()
239 {
240 assert !this.destroyed.get() : "trying to use a destroyed object";
241 return native_getName(this.nativeRef);
242 }
243 private native String native_getName(long _nativeRef);
244
245 @Override
246 public float getWidth()
247 {
248 assert !this.destroyed.get() : "trying to use a destroyed object";
249 return native_getWidth(this.nativeRef);
250 }
251 private native float native_getWidth(long _nativeRef);
252
253 @Override
254 public float getHeight()
255 {
256 assert !this.destroyed.get() : "trying to use a destroyed object";
257 return native_getHeight(this.nativeRef);
258 }
259 private native float native_getHeight(long _nativeRef);
260
261 @Override
262 public Float getAltitude()
263 {
264 assert !this.destroyed.get() : "trying to use a destroyed object";
265 return native_getAltitude(this.nativeRef);
266 }
267 private native Float native_getAltitude(long _nativeRef);
268
269 @Override
270 public float getAzimuth()
271 {
272 assert !this.destroyed.get() : "trying to use a destroyed object";
273 return native_getAzimuth(this.nativeRef);
274 }
275 private native float native_getAzimuth(long _nativeRef);
276
277 @Override
278 public GlobalPoint getOriginPoint()
279 {
280 assert !this.destroyed.get() : "trying to use a destroyed object";
281 return native_getOriginPoint(this.nativeRef);
282 }
283 private native GlobalPoint native_getOriginPoint(long _nativeRef);
284
285 @Override
286 public String getLevelId()
287 {
288 assert !this.destroyed.get() : "trying to use a destroyed object";
289 return native_getLevelId(this.nativeRef);
290 }
291 private native String native_getLevelId(long _nativeRef);
292
293 @Override
294 public String getExternalId()
295 {
296 assert !this.destroyed.get() : "trying to use a destroyed object";
297 return native_getExternalId(this.nativeRef);
298 }
299 private native String native_getExternalId(long _nativeRef);
300
301 @Override
302 public ArrayList<Beacon> getBeacons()
303 {
304 assert !this.destroyed.get() : "trying to use a destroyed object";
305 return native_getBeacons(this.nativeRef);
306 }
307 private native ArrayList<Beacon> native_getBeacons(long _nativeRef);
308
309 @Override
310 public ArrayList<Eddystone> getEddystones()
311 {
312 assert !this.destroyed.get() : "trying to use a destroyed object";
313 return native_getEddystones(this.nativeRef);
314 }
315 private native ArrayList<Eddystone> native_getEddystones(long _nativeRef);
316
317 @Override
318 public ArrayList<Wifi> getWifis()
319 {
320 assert !this.destroyed.get() : "trying to use a destroyed object";
321 return native_getWifis(this.nativeRef);
322 }
323 private native ArrayList<Wifi> native_getWifis(long _nativeRef);
324
325 @Override
326 public ArrayList<ReferencePoint> getReferencePoints()
327 {
328 assert !this.destroyed.get() : "trying to use a destroyed object";
329 return native_getReferencePoints(this.nativeRef);
330 }
331 private native ArrayList<ReferencePoint> native_getReferencePoints(long _nativeRef);
332
333 @Override
334 public ArrayList<Venue> getVenues()
335 {
336 assert !this.destroyed.get() : "trying to use a destroyed object";
337 return native_getVenues(this.nativeRef);
338 }
339 private native ArrayList<Venue> native_getVenues(long _nativeRef);
340
341 @Override
342 public ArrayList<Zone> getZones()
343 {
344 assert !this.destroyed.get() : "trying to use a destroyed object";
345 return native_getZones(this.nativeRef);
346 }
347 private native ArrayList<Zone> native_getZones(long _nativeRef);
348 }
349}