Hexagon
Loading...
Searching...
No Matches
HexCollections Class Reference

Class for extensions over collections, such as lists, arrays or IEnumerable-s. More...

Static Public Member Functions

static bool AreListsEqual< T > (this List< T > list1, List< T > list2)
 Checks if two lists are completely equal (same length, same objects, and same order).
 
static bool AreSetsEqual< T > (this List< T > list1, List< T > list2)
 Checks if two lists contain the same unique objects, regardless of order.
 
static bool AreMultisetsEqual< T > (this List< T > list1, List< T > list2)
 Checks if two lists contain the same objects with the same number of occurrences, regardless of order.
 
static ? int FirstNullIndex< T > (this IEnumerable< T > collection)
 Returns index of the first element in the collection which is null. If it is empty or all elements are not null, the return value is -1.
 
static ? int FirstNotNullIndex< T > (this IEnumerable< T > collection)
 Returns index of the first element in the collection which is not null. If it is empty or all elements are null, the return value is -1.
 
static int GetLength< T > (this IEnumerable< T > collection)
 
static bool AddIfNew< T > (this ICollection< T > list, T item)
 

Detailed Description

Class for extensions over collections, such as lists, arrays or IEnumerable-s.

Member Function Documentation

◆ AddIfNew< T >()

static bool HexCollections.AddIfNew< T > ( this ICollection< T > list,
T item )
inlinestatic

◆ AreListsEqual< T >()

static bool HexCollections.AreListsEqual< T > ( this List< T > list1,
List< T > list2 )
inlinestatic

Checks if two lists are completely equal (same length, same objects, and same order).

◆ AreMultisetsEqual< T >()

static bool HexCollections.AreMultisetsEqual< T > ( this List< T > list1,
List< T > list2 )
inlinestatic

Checks if two lists contain the same objects with the same number of occurrences, regardless of order.

◆ AreSetsEqual< T >()

static bool HexCollections.AreSetsEqual< T > ( this List< T > list1,
List< T > list2 )
inlinestatic

Checks if two lists contain the same unique objects, regardless of order.

◆ FirstNotNullIndex< T >()

static ? int HexCollections.FirstNotNullIndex< T > ( this IEnumerable< T > collection)
inlinestatic

Returns index of the first element in the collection which is not null. If it is empty or all elements are null, the return value is -1.

◆ FirstNullIndex< T >()

static ? int HexCollections.FirstNullIndex< T > ( this IEnumerable< T > collection)
inlinestatic

Returns index of the first element in the collection which is null. If it is empty or all elements are not null, the return value is -1.

◆ GetLength< T >()

static int HexCollections.GetLength< T > ( this IEnumerable< T > collection)
inlinestatic

The documentation for this class was generated from the following file: