Loading...
Searching...
No Matches
Wifi.java
Go to the documentation of this file.
1package com.navigine.idl.java;
2
3import java.util.concurrent.atomic.AtomicBoolean;
4
18public abstract class Wifi {
32 public abstract Point getPoint();
33
47 public abstract int getLocationId();
48
62 public abstract int getSublocationId();
63
77 public abstract String getName();
78
92 public abstract String getMac();
93
107 public abstract TransmitterStatus getStatus();
108
109 private static final class CppProxy extends Wifi
110 {
111 private final long nativeRef;
112 private final AtomicBoolean destroyed = new AtomicBoolean(false);
113
114 private CppProxy(long nativeRef)
115 {
116 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
117 this.nativeRef = nativeRef;
118 }
119
120 private native void nativeDestroy(long nativeRef);
121 public void _djinni_private_destroy()
122 {
123 boolean destroyed = this.destroyed.getAndSet(true);
124 if (!destroyed) nativeDestroy(this.nativeRef);
125 }
126 protected void finalize() throws java.lang.Throwable
127 {
128 _djinni_private_destroy();
129 super.finalize();
130 }
131
132 // Wifi methods
133
134 @Override
135 public Point getPoint()
136 {
137 assert !this.destroyed.get() : "trying to use a destroyed object";
138 return native_getPoint(this.nativeRef);
139 }
140 private native Point native_getPoint(long _nativeRef);
141
142 @Override
143 public int getLocationId()
144 {
145 assert !this.destroyed.get() : "trying to use a destroyed object";
146 return native_getLocationId(this.nativeRef);
147 }
148 private native int native_getLocationId(long _nativeRef);
149
150 @Override
151 public int getSublocationId()
152 {
153 assert !this.destroyed.get() : "trying to use a destroyed object";
154 return native_getSublocationId(this.nativeRef);
155 }
156 private native int native_getSublocationId(long _nativeRef);
157
158 @Override
159 public String getName()
160 {
161 assert !this.destroyed.get() : "trying to use a destroyed object";
162 return native_getName(this.nativeRef);
163 }
164 private native String native_getName(long _nativeRef);
165
166 @Override
167 public String getMac()
168 {
169 assert !this.destroyed.get() : "trying to use a destroyed object";
170 return native_getMac(this.nativeRef);
171 }
172 private native String native_getMac(long _nativeRef);
173
174 @Override
175 public TransmitterStatus getStatus()
176 {
177 assert !this.destroyed.get() : "trying to use a destroyed object";
178 return native_getStatus(this.nativeRef);
179 }
180 private native TransmitterStatus native_getStatus(long _nativeRef);
181 }
182}