ISet Interface

Provides access to members that control a simple set of objects.

Description

The ISet interface provides properties and methods for adding objects, removing objects, and sequentially accessing objects in a Set.

When To Use

The Set object holds a collection of homogeneous or heterogeneous objects.

Members

Name Description
Method Add Adds an object to the set.
Read-only property Count The element count of the set.
Method Find Searches for the object in the set.
Method Next Obtains the next object in the set.
Method Remove Removes the object from the set.
Method RemoveAll Removes all objects from the set.
Method Reset Resets the set for enumerating through the objects with Next.

ISet.Add Method

Adds an object to the set.

Public Sub Add ( _
    ByVal unk As Object _
)
public void Add (
    object unk
);

Description

Adds the specified object to the Set. If you add the same object to a Set twice, no error occurs but the resulting Set has only one reference to the object.

Remarks

The order in which objects are added to the Set using Add is not guaranteed to be the same order in which they are returned by the Next method.

When adding an object to a Set, you are merely adding a new reference to the object not copying it. The reference is released when the Set is destroyed or the object is removed. For example, if you add geodatabase features to a Set (or an Array) using a feature cursor, you must use a non-recycling cursor, otherwise the memory location of the previous feature is overwritten.

ISet.Count Property

The element count of the set.

Public ReadOnly Property Count As Integer
public int Count {get;}

Description

Returns the number of objects in the Set.

ISet.Find Method

Searches for the object in the set.

Public Function Find ( _
    ByVal unk As Object _
) As Boolean
public bool Find (
    object unk
);

Description

Indicates whether a reference to the specified object has been added to the Set with the Add method.

ISet.Next Method

Obtains the next object in the set.

Public Function Next ( _
) As Object
public object Next (
);

Description

The Next method returns the next object in the Set.

Remarks

The order that objects are returned from the Set object using the Next method is not guaranteed to be the same order as they were passed into the Add method. However, the Next method will return the objects in the same order.

ISet.Remove Method

Removes the object from the set.

Public Sub Remove ( _
    ByVal unk As Object _
)
public void Remove (
    object unk
);

Description

Removes the reference to the specified object from the Set.

ISet.RemoveAll Method

Removes all objects from the set.

Public Sub RemoveAll ( _
)
public void RemoveAll (
);

Description

Removes all references to objects from the Set.

ISet.Reset Method

Resets the set for enumerating through the objects with Next.

Public Sub Reset ( _
)
public void Reset (
);

Description

The Reset method resets the Set so that the next call to the Next method returns the first object in the Set.

Remarks

The order that objects are returned from the Set object using the Next method is not guaranteed to be the same order as they were passed into the Add method. However, the Next method will return the objects in the same order.

Classes that implement ISet

Classes Description
Set Generic set of objects.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.