HashSet Constructors

Definition

Overloads

HashSet()

Constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.

HashSet(ICollection)

Constructs a new set containing the elements in the specified collection.

HashSet(Int32)

Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor (0.

HashSet(Int32, Single)

Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and the specified load factor.

HashSet(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

HashSet()

Constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.

[Android.Runtime.Register(".ctor", "()V", "")]
public HashSet ();
Attributes

Remarks

Constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.75).

Java documentation for java.util.HashSet.HashSet().

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

HashSet(ICollection)

Constructs a new set containing the elements in the specified collection.

[Android.Runtime.Register(".ctor", "(Ljava/util/Collection;)V", "")]
public HashSet (System.Collections.ICollection c);
[<Android.Runtime.Register(".ctor", "(Ljava/util/Collection;)V", "")>]
new Java.Util.HashSet : System.Collections.ICollection -> Java.Util.HashSet

Parameters

c
ICollection

the collection whose elements are to be placed into this set

Attributes

Remarks

Constructs a new set containing the elements in the specified collection. The HashMap is created with default load factor (0.75) and an initial capacity sufficient to contain the elements in the specified collection.

Java documentation for java.util.HashSet.HashSet(java.util.Collection<? extends E>).

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

HashSet(Int32)

Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor (0.

[Android.Runtime.Register(".ctor", "(I)V", "")]
public HashSet (int initialCapacity);
[<Android.Runtime.Register(".ctor", "(I)V", "")>]
new Java.Util.HashSet : int -> Java.Util.HashSet

Parameters

initialCapacity
Int32

the initial capacity of the hash table

Attributes

Remarks

Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor (0.75).

Java documentation for java.util.HashSet.HashSet(int).

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

HashSet(Int32, Single)

Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and the specified load factor.

[Android.Runtime.Register(".ctor", "(IF)V", "")]
public HashSet (int initialCapacity, float loadFactor);
[<Android.Runtime.Register(".ctor", "(IF)V", "")>]
new Java.Util.HashSet : int * single -> Java.Util.HashSet

Parameters

initialCapacity
Int32

the initial capacity of the hash map

loadFactor
Single

the load factor of the hash map

Attributes

Remarks

Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and the specified load factor.

Java documentation for java.util.HashSet.HashSet(int, float).

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

HashSet(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected HashSet (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Util.HashSet : nativeint * Android.Runtime.JniHandleOwnership -> Java.Util.HashSet

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

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