PeterO.ArrayUtil
## PeterO.ArrayUtil
public static class ArrayUtil
Not documented yet.
Member Summary
[ArrayHashCode(System.Collections.Generic.IEnumerable)](#ArrayHashCode_System_Collections_Generic_IEnumerable)
- Not documented yet. Not documented yet. Not documented yet. Not documented yet.[ArrayHashCode<T>(System.Collections.Generic.IEnumerable<T>)](#ArrayHashCode_T_System_Collections_Generic_IEnumerable_T)
- Not documented yet.[ArraysEqual<T>(System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IEnumerable<T>)](#ArraysEqual_T_System_Collections_Generic_IEnumerable_T_System_Collections_Generic_IEnumerable_T)
- Determines whether two enumerable objects are equal.[ArraysEqual<T>(System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IEqualityComparer<T>)](#ArraysEqual_T_System_Collections_Generic_IEnumerable_T_System_Collections_Generic_IEnumerable_T_System_Collections_Generic_IEqualityComparer_T)
- Determines whether two enumerable objects are equal.[ArrayToString<T>(System.Collections.Generic.IEnumerable<T>)](#ArrayToString_T_System_Collections_Generic_IEnumerable_T)
- Not documented yet.[ArrayToStringHex(System.Collections.Generic.IEnumerable)](#ArrayToStringHex_System_Collections_Generic_IEnumerable)
- Not documented yet. Not documented yet.[CompareArrays<T>(System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IComparer<T>) where T : System.IComparable<T>T](#CompareArrays_T_System_Collections_Generic_IEnumerable_T_System_Collections_Generic_IEnumerable_T_System_Collections_Generic_IComparer_T_where_T_System_IComparable_T_T)
- Not documented yet.[CompareArrays<T>(System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IEnumerable<T>) where T : System.IComparable<T>T](#CompareArrays_T_System_Collections_Generic_IEnumerable_T_System_Collections_Generic_IEnumerable_T_where_T_System_IComparable_T_T)
- Not documented yet.[CompareLists<T>(System.Collections.Generic.IList<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IComparer<T>) where T : System.IComparable<T>T](#CompareLists_T_System_Collections_Generic_IList_T_System_Collections_Generic_IList_T_System_Collections_Generic_IComparer_T_where_T_System_IComparable_T_T)
- Compares two lists with the same type of items.[CompareLists<T>(System.Collections.Generic.IList<T>, System.Collections.Generic.IList<T>) where T : System.IComparable<T>T](#CompareLists_T_System_Collections_Generic_IList_T_System_Collections_Generic_IList_T_where_T_System_IComparable_T_T)
- Compares two lists with the same type of items.[FindItem<T>(System.Collections.Generic.IEnumerable<T>, System.Predicate<T>, T)](#FindItem_T_System_Collections_Generic_IEnumerable_T_System_Predicate_T_T)
- Not documented yet.[FindItem<T>(System.Collections.Generic.IEnumerable<T>, T, T)](#FindItem_T_System_Collections_Generic_IEnumerable_T_T_T)
- Finds an item or returns a default value if an item is not found.[Reverse<T>(System.Collections.Generic.IList<T>)](#Reverse_T_System_Collections_Generic_IList_T)
- Reverses the order of the elements in the given list.[Reverse<T>(System.Collections.Generic.IList<T>, int, int)](#Reverse_T_System_Collections_Generic_IList_T_int_int)
- Reverses the order of the elements in the given list at the specified index and length.[Shuffle<T>(System.Collections.Generic.IList<T>, System.Random)](#Shuffle_T_System_Collections_Generic_IList_T_System_Random)
- Randomizes the order of a list’s items.[ToArray<T>(System.Collections.Generic.IEnumerable<T>)](#ToArray_T_System_Collections_Generic_IEnumerable_T)
- Converts an enumerable to an array.
public static int ArrayHashCode( System.Collections.Generic.IEnumerable array);
Not documented yet.
Parameters:
- array: The parameter array is a.Collections.Generic.IEnumerable{System.Double} object.
Return Value:
A 32-bit signed integer.
public static int ArrayHashCode<T>( System.Collections.Generic.IEnumerable<T> array);
Not documented yet.
Parameters:
-
array: The parameter array is a.Collections.Generic.IEnumerable{``0} object.
-
<T>: Type parameter not documented yet.
Return Value:
A 32-bit signed integer.
public static bool ArraysEqual<T>( System.Collections.Generic.IEnumerable<T> array1, System.Collections.Generic.IEnumerable<T> array2);
Determines whether two enumerable objects are equal.
Parameters:
-
array1: First enumerable to compare.
-
array2: Second enumerable to compare.
-
<T>: Any object type.
Return Value:
true
if both enumerable objects are null or both enumerable objects have the same elements and number of elements in the same order; otherwise, false
.
public static bool ArraysEqual<T>( System.Collections.Generic.IEnumerable<T> array1, System.Collections.Generic.IEnumerable<T> array2, System.Collections.Generic.IEqualityComparer<T> comparer);
Determines whether two enumerable objects are equal.
Parameters:
-
array1: The parameter array1 is a.Collections.Generic.IEnumerable{``0} object.
-
array2: The parameter array2 is a.Collections.Generic.IEnumerable{``0} object.
-
comparer: The parameter comparer is a.Collections.Generic.IEqualityComparer{``0} object.
-
<T>: Not documented yet.
Return Value:
true
if two enumerable objects are equal; otherwise, false
.
Exceptions:
- System.ArgumentNullException: The parameter comparer is null.
public static string ArrayToString<T>( System.Collections.Generic.IEnumerable<T> array);
Not documented yet.
Parameters:
-
array: The parameter array is a.Collections.Generic.IEnumerable{``0} object.
-
<T>: Type parameter not documented yet.
Return Value:
A text string.
public static string ArrayToStringHex( System.Collections.Generic.IEnumerable array);
Not documented yet.
Parameters:
- array: The parameter array is a.Collections.Generic.IEnumerable{System.Int32} object.
Return Value:
A text string.
public static int CompareArrays<T>( System.Collections.Generic.IEnumerable<T> array1, System.Collections.Generic.IEnumerable<T> array2) where T : System.IComparable<T>T;
Not documented yet.
Parameters:
-
array1: The parameter array1 is a.Collections.Generic.IEnumerable{``0} object.
-
array2: The parameter array2 is a.Collections.Generic.IEnumerable{``0} object.
-
<T>: Type parameter not documented yet.
Return Value:
A 32-bit signed integer.
public static int CompareArrays<T>( System.Collections.Generic.IEnumerable<T> array1, System.Collections.Generic.IEnumerable<T> array2, System.Collections.Generic.IComparer<T> comparer) where T : System.IComparable<T>T;
Not documented yet.
Parameters:
-
array1: The parameter array1 is a.Collections.Generic.IEnumerable{``0} object.
-
array2: The parameter array2 is a.Collections.Generic.IEnumerable{``0} object.
-
comparer: The parameter comparer is a.Collections.Generic.IComparer{``0} object.
-
<T>: Type parameter not documented yet.
Return Value:
A 32-bit signed integer.
Exceptions:
- System.ArgumentNullException: The parameter comparer is null.
public static int CompareLists<T>( System.Collections.Generic.IList<T> list1, System.Collections.Generic.IList<T> list2) where T : System.IComparable<T>T;
Compares two lists with the same type of items.
Parameters:
-
list1: The parameter list1 is a.Collections.Generic.IList{``0} object.
-
list2: The parameter list2 is a.Collections.Generic.IList{``0} object.
-
<T>: Type parameter not documented yet.
Return Value:
A 32-bit signed integer.
public static int CompareLists<T>( System.Collections.Generic.IList<T> list1, System.Collections.Generic.IList<T> list2, System.Collections.Generic.IComparer<T> comparer) where T : System.IComparable<T>T;
Compares two lists with the same type of items.
Parameters:
-
list1: The parameter list1 is a.Collections.Generic.IList{``0} object.
-
list2: The parameter list2 is a.Collections.Generic.IList{``0} object.
-
comparer: The parameter comparer is a.Collections.Generic.IComparer{``0} object.
-
<T>: Not documented yet.
Return Value:
A 32-bit signed integer.
Exceptions:
- System.ArgumentNullException: The parameter comparer is null.
public static T FindItem<T>( System.Collections.Generic.IEnumerable<T> items, System.Predicate<T> func, T defaultValue);
Not documented yet.
Parameters:
-
items: The parameter items is a.Collections.Generic.IEnumerable{``0} object.
-
func: The parameter func is a.Predicate{``0} object.
-
defaultValue: The parameter defaultValue is a ``0 object.
-
<T>: Type parameter not documented yet.
Return Value:
A T object.
Exceptions:
- System.ArgumentNullException: The parameter items or func is null.
public static T FindItem<T>( System.Collections.Generic.IEnumerable<T> items, T itemToFind, T defaultValue);
Finds an item or returns a default value if an item is not found.
Parameters:
-
items: The parameter items is a.Collections.Generic.IEnumerable{``0} object.
-
itemToFind: The parameter itemToFind is a ``0 object.
-
defaultValue: The parameter defaultValue is a ``0 object.
-
<T>: Not documented yet.
Return Value:
A T object.
Exceptions:
- System.ArgumentNullException: The parameter items is null.
public static void Reverse<T>( System.Collections.Generic.IList<T> list);
Reverses the order of the elements in the given list.
Parameters:
-
list: The parameter list is an IList object.
-
<T>: Any object type.
Exceptions:
- System.ArgumentNullException: The parameter list is null.
public static void Reverse<T>( System.Collections.Generic.IList<T> list, int index, int count);
Reverses the order of the elements in the given list at the specified index and length.
Parameters:
-
list: The list where the order of elements should be reversed.
-
index: An index starting at 0 showing where the desired portion of list begins.
-
count: The number of elements in the desired portion of list (but not more than list ‘s length).
-
<T>: Any object type.
Exceptions:
-
System.ArgumentException: Either index or count is less than 0 or greater than list ‘s length, or list ‘s length minus index is less than count .
-
System.ArgumentNullException: The parameter list is null.
public static void Shuffle<T>( System.Collections.Generic.IList<T> list, System.Random random);
Randomizes the order of a list’s items.
Parameters:
-
list: The parameter list is an IList object.
-
random: The parameter random is a Random object.
-
<T>: Any object type.
Exceptions:
- System.ArgumentNullException: The parameter random or list is null.
public static PeterO.T<>[] ToArray<T>( System.Collections.Generic.IEnumerable<T> collection);
Converts an enumerable to an array.
Parameters:
-
collection: The parameter collection is a.Collections.Generic.IEnumerable{``0} object.
-
<T>: Not documented yet.
Return Value:
A T[] object.
Exceptions:
- System.ArgumentNullException: The parameter collection is null.