Skip to content

T_CodeJam_Collections_CollectionExtensions

Andrew Koryavchenko edited this page Jun 17, 2018 · 7 revisions

CollectionExtensions Class

Various collections extensions.

Inheritance Hierarchy

System.Object
  CodeJam.Collections.CollectionExtensions
Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public static class CollectionExtensions

VB

<ExtensionAttribute>
Public NotInheritable Class CollectionExtensions

F#

[<AbstractClassAttribute>]
[<SealedAttribute>]
[<ExtensionAttribute>]
type CollectionExtensions =  class end

Methods

 

Name Description
Public methodStatic member AddRange(T)(ICollection(T), IEnumerable(T)) Adds the elements to the end of the ICollection(T).
Public methodStatic member AddRange(T)(ICollection(T), IList(T)) Adds the elements to the end of the ICollection(T).
Public methodStatic member AddRange(T)(ICollection(T), T[]) Adds the elements to the end of the ICollection(T).
Public methodStatic member DefaultIfEmpty(T)(List(T), T) Returns a new collection with default value if the collection is empty.
Public methodStatic member DefaultIfEmpty(T)(T[], T) Returns a new array with default value if the array is empty.
Public methodStatic member DefaultIfEmpty(TKey, TValue)(Dictionary(TKey, TValue), TKey, TValue) Returns a new dictionary with default value if the dictionary is empty.
Public methodStatic member DefaultIfEmpty(TKey, TValue)(Dictionary(TKey, TValue), TKey, TValue, IEqualityComparer(TKey)) Returns a new dictionary with default value if the dictionary is empty.
Public methodStatic member EmptyIfNull(T)(IEnumerable(T)) Returns an empty instance of the collection for null values.
Public methodStatic member EmptyIfNull(T)(List(T)) Returns an empty instance of the collection for null values.
Public methodStatic member EmptyIfNull(T)(T[]) Returns an empty instance of the array for null values.
Public methodStatic member EmptyIfNull(TKey, TValue)(Dictionary(TKey, TValue)) Returns an empty instance of the dictionary for null values.
Public methodStatic member EmptyIfNull(TKey, TValue)(Dictionary(TKey, TValue), IEqualityComparer(TKey)) Returns an empty instance of the dictionary for null values.
Public methodStatic member IsNullOrEmpty(T)(ICollection(T)) Indicates whether the specified collection is null or empty.
Public methodStatic member IsNullOrEmpty(T)(T[]) Indicates whether the specified array is null or empty.
Public methodStatic member NotNullNorEmpty(T)(ICollection(T)) Indicates whether the specified collection is not null nor empty.
Public methodStatic member NotNullNorEmpty(T)(T[]) Indicates whether the specified array is is not null nor empty.
Public methodStatic member NullIfEmpty(T)(List(T)) Returns null if the collection is empty.
Public methodStatic member NullIfEmpty(T)(T[]) Returns null if the collection is array.
Public methodStatic member NullIfEmpty(TKey, TValue)(Dictionary(TKey, TValue)) Returns null if the dictionary is empty.
  Back to Top

See Also

Reference

CodeJam.Collections Namespace

Clone this wiki locally