GH_ListUtil

public sealed class GH_ListUtil
Provides utilities for dealing with list of Data from input parameters.

Methods

CountNonNullRefs<T>

#
public static int CountNonNullRefs<T>(List<T> L)
Count all object references in L
L (List<T>)List to parse
Number of proper objects in L

CountNullRefs<T>

#
public static int CountNullRefs<T>(List<T> L)
Count all null references in L
L (List<T>)List to parse
Number of nulls in L

EnsureNonNullCount<T>

#
public static bool EnsureNonNullCount<T>(List<T> L, int N)
Tests a list to see if it contains sufficient non-null references.
L (List<T>)List to parse
N (int)
True if L contains N or more non-null references.

FirstNonNullItem<T>

#
public static int FirstNonNullItem<T>(List<T> L)
Returns the index of the first non-null item in a list.
L (List<T>)List to parse.
The index of the first non-null item or -1 if no object reference could be found.

RemoveNullRefs<T>

#
public static List<T> RemoveNullRefs<T>(List<T> L)
Remove all null references from a list of items.
L (List<T>)List to filter
List containing only non-null items. References are shared with L