Freigeben über


LruCache.SizeOf(Object, Object) Method

Definition

Returns the size of the entry for key and value in user-defined units.

[Android.Runtime.Register("sizeOf", "(Ljava/lang/Object;Ljava/lang/Object;)I", "GetSizeOf_Ljava_lang_Object_Ljava_lang_Object_Handler")]
protected virtual int SizeOf (Java.Lang.Object? key, Java.Lang.Object? value);
[<Android.Runtime.Register("sizeOf", "(Ljava/lang/Object;Ljava/lang/Object;)I", "GetSizeOf_Ljava_lang_Object_Ljava_lang_Object_Handler")>]
abstract member SizeOf : Java.Lang.Object * Java.Lang.Object -> int
override this.SizeOf : Java.Lang.Object * Java.Lang.Object -> int

Parameters

key
Object
value
Object

Returns

Attributes

Remarks

Returns the size of the entry for key and value in user-defined units. The default implementation returns 1 so that size is the number of entries and max size is the maximum number of entries.

An entry's size must not change while it is in the cache.

Java documentation for android.util.LruCache.sizeOf(K, V).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to