# Xui.Core.Set

Assembly: **Xui.Core** · [C# declarations](index.cs) · [Assembly overview](../index.md)

## Types

- [`class EmptySet<T>`](#api-24884bdff317bbea)
- [`interface INonEnumerableSet<T>`](#api-f9019abe5693ecd3)

<a id="api-24884bdff317bbea"></a>

## `class EmptySet<T>`

Represents an empty set — a set that contains no elements.

- **`T`** — The type of elements the set could (but does not) contain.

This type always returns `false` from [`Xui.Core.Set.EmptySet`1.Contains(`0)`](../xui-core-set/index.md#api-5d556e1a8179bfaa). It is a useful identity for set composition and for scenarios like default hit test areas or disabled regions.

```csharp
public sealed class EmptySet<T> : INonEnumerableSet<T>
{
    public static readonly EmptySet<T> Instance;
    public bool Contains(T obj);
}
```

<a id="api-5d556e1a8179bfaa"></a>

### [`bool EmptySet<T>.Contains(T obj)`](#api-5d556e1a8179bfaa)


```csharp
public bool Contains(T obj);
```

Always returns `false`, since no element belongs to the empty set.

- **`obj`** — The object to test.

**Returns:** `false` for all inputs.

<a id="api-74a020f8ee7f0a8b"></a>

### [`EmptySet<T> EmptySet<T>.Instance`](#api-74a020f8ee7f0a8b)


```csharp
public static readonly EmptySet<T> Instance;
```

A shared singleton instance of the empty set.


<a id="api-f9019abe5693ecd3"></a>

## `interface INonEnumerableSet<T>`

Represents a mathematical set as defined by its membership test: whether an element belongs to the set.

- **`T`** — The type of elements being tested for membership.

This interface does not imply enumeration, mutation, or collection semantics. It aligns with the pure set-theoretic notion where a set is characterized solely by the ability to determine if a value is a member of the set (i.e., `x ∈ S`).

```csharp
public interface INonEnumerableSet<T>
{
    public bool Contains(T obj);
}
```

<a id="api-d8e7de78aa12cec8"></a>

### [`bool INonEnumerableSet<T>.Contains(T obj)`](#api-d8e7de78aa12cec8)


```csharp
public bool Contains(T obj);
```

Determines whether the specified element is a member of this set.

- **`obj`** — The element to test for membership.

**Returns:** `true` if the element belongs to the set; otherwise, `false`.

