Ejemplo n.º 1
0
		//
		// Exception audit:
		//
		//  Verdict
		//    No need to wrap thrown exceptions in a BCL class
		//
		//  Rationale
		//    `java.util.Map.keySet()` is not documented to throw any exceptions.
		//
		internal IntPtr GetKeys ()
		{
			if (id_keySet == IntPtr.Zero)
				id_keySet = JNIEnv.GetMethodID (map_class, "keySet", "()Ljava/util/Set;");
			return JNIEnv.CallObjectMethod (Handle, id_keySet);
		}
Ejemplo n.º 2
0
        internal void Put(object key, object value)
        {
            if (id_put == IntPtr.Zero)
            {
                id_put = JNIEnv.GetMethodID(map_class, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
            }
            IntPtr r = JavaConvert.WithLocalJniHandle(key,
                                                      lrefKey => JavaConvert.WithLocalJniHandle(value,
                                                                                                lrefValue => JNIEnv.CallObjectMethod(Handle, id_put, new JValue(lrefKey), new JValue(lrefValue))));

            JNIEnv.DeleteLocalRef(r);
        }
Ejemplo n.º 3
0
		//
		// Exception audit:
		//
		//  Verdict
		//    No need to wrap thrown exceptions in a BCL class
		//
		//  Rationale
		//    `java.util.Map.values()` is not documented to throw any exceptions.
		//
		internal IntPtr GetValues ()
		{
			if (id_values == IntPtr.Zero)
				id_values = JNIEnv.GetMethodID (map_class, "values", "()Ljava/util/Collection;");
			return JNIEnv.CallObjectMethod (Handle, id_values);
		}