49 public abstract ArrayList<String>
getKeys();
68 public abstract int getInt(String key,
int defaultValue);
87 public abstract long getLong(String key,
long defaultValue);
106 public abstract boolean getBool(String key,
boolean defaultValue);
125 public abstract float getFloat(String key,
float defaultValue);
144 public abstract double getDouble(String key,
double defaultValue);
163 public abstract String
getString(String key, String defaultValue);
180 public abstract void putInt(String key,
int value);
197 public abstract void putLong(String key,
long value);
214 public abstract void putBool(String key,
boolean value);
231 public abstract void putFloat(String key,
float value);
248 public abstract void putDouble(String key,
double value);
265 public abstract void putString(String key, String value);
281 public abstract void remove(String key);
300 private final long nativeRef;
301 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
303 private CppProxy(
long nativeRef)
305 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
306 this.nativeRef = nativeRef;
309 private native
void nativeDestroy(
long nativeRef);
310 public void _djinni_private_destroy()
312 boolean destroyed = this.destroyed.getAndSet(
true);
313 if (!destroyed) nativeDestroy(this.nativeRef);
315 protected void finalize() throws
java.lang.Throwable
317 _djinni_private_destroy();
324 public boolean contains(String key)
326 assert !this.destroyed.get() :
"trying to use a destroyed object";
327 return native_contains(this.nativeRef, key);
329 private native
boolean native_contains(
long _nativeRef, String key);
332 public ArrayList<String> getKeys()
334 assert !this.destroyed.get() :
"trying to use a destroyed object";
335 return native_getKeys(this.nativeRef);
337 private native ArrayList<String> native_getKeys(
long _nativeRef);
340 public int getInt(String key,
int defaultValue)
342 assert !this.destroyed.get() :
"trying to use a destroyed object";
343 return native_getInt(this.nativeRef, key, defaultValue);
345 private native
int native_getInt(
long _nativeRef, String key,
int defaultValue);
348 public long getLong(String key,
long defaultValue)
350 assert !this.destroyed.get() :
"trying to use a destroyed object";
351 return native_getLong(this.nativeRef, key, defaultValue);
353 private native
long native_getLong(
long _nativeRef, String key,
long defaultValue);
356 public boolean getBool(String key,
boolean defaultValue)
358 assert !this.destroyed.get() :
"trying to use a destroyed object";
359 return native_getBool(this.nativeRef, key, defaultValue);
361 private native
boolean native_getBool(
long _nativeRef, String key,
boolean defaultValue);
364 public float getFloat(String key,
float defaultValue)
366 assert !this.destroyed.get() :
"trying to use a destroyed object";
367 return native_getFloat(this.nativeRef, key, defaultValue);
369 private native
float native_getFloat(
long _nativeRef, String key,
float defaultValue);
372 public double getDouble(String key,
double defaultValue)
374 assert !this.destroyed.get() :
"trying to use a destroyed object";
375 return native_getDouble(this.nativeRef, key, defaultValue);
377 private native
double native_getDouble(
long _nativeRef, String key,
double defaultValue);
380 public String getString(String key, String defaultValue)
382 assert !this.destroyed.get() :
"trying to use a destroyed object";
383 return native_getString(this.nativeRef, key, defaultValue);
385 private native String native_getString(
long _nativeRef, String key, String defaultValue);
388 public void putInt(String key,
int value)
390 assert !this.destroyed.get() :
"trying to use a destroyed object";
391 native_putInt(this.nativeRef, key, value);
393 private native
void native_putInt(
long _nativeRef, String key,
int value);
396 public void putLong(String key,
long value)
398 assert !this.destroyed.get() :
"trying to use a destroyed object";
399 native_putLong(this.nativeRef, key, value);
401 private native
void native_putLong(
long _nativeRef, String key,
long value);
404 public void putBool(String key,
boolean value)
406 assert !this.destroyed.get() :
"trying to use a destroyed object";
407 native_putBool(this.nativeRef, key, value);
409 private native
void native_putBool(
long _nativeRef, String key,
boolean value);
412 public void putFloat(String key,
float value)
414 assert !this.destroyed.get() :
"trying to use a destroyed object";
415 native_putFloat(this.nativeRef, key, value);
417 private native
void native_putFloat(
long _nativeRef, String key,
float value);
420 public void putDouble(String key,
double value)
422 assert !this.destroyed.get() :
"trying to use a destroyed object";
423 native_putDouble(this.nativeRef, key, value);
425 private native
void native_putDouble(
long _nativeRef, String key,
double value);
428 public void putString(String key, String value)
430 assert !this.destroyed.get() :
"trying to use a destroyed object";
431 native_putString(this.nativeRef, key, value);
433 private native
void native_putString(
long _nativeRef, String key, String value);
436 public void remove(String key)
438 assert !this.destroyed.get() :
"trying to use a destroyed object";
439 native_remove(this.nativeRef, key);
441 private native
void native_remove(
long _nativeRef, String key);
446 assert !this.destroyed.get() :
"trying to use a destroyed object";
447 native_clear(this.nativeRef);
449 private native
void native_clear(
long _nativeRef);