ImmutableListT Class

A list that can be modified until IsReadOnly is set to true. Once this occurs, the list itself can no longer be modified. Remember, this does not cause objects contained in this class to be Immutable unless they implement IImmutableObject.

Definition

Namespace: SnapDB.Immutables
Assembly: SnapDB (in SnapDB.dll) Version: 1.0.102.0 -- Release Build+29075351d0e5aa4dea46a5c520805222f672dc2e
public class ImmutableList<T> : ImmutableObjectBase<ImmutableList<T>>, 
	IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Inheritance
Object    ImmutableObjectBaseImmutableListT    ImmutableListT
Implements
ICollectionT, IEnumerableT, IListT, IEnumerable

Type Parameters

T
List type.

Constructors

ImmutableListT(FuncT, T) Creates a new ImmutableListT.
ImmutableListT(Int32, FuncT, T) Creates a new ImmutableListT.

Properties

Count Gets the number of elements contained in the ICollection.
IsReadOnly Gets or sets if this class is immutable and thus read-only. Once setting to read-only, the class becomes immutable.
(Inherited from ImmutableObjectBaseT)
Item Gets or sets the element at the specified index.

Methods

AddAdds an item to the ICollection.
AddRange Adds the elements of the specified collection to the end of the ListT.
Clear Removes all items from the collection.
Clone Creates a clone of the object, either as a read-only instance or an editable one.
(Inherited from ImmutableObjectBaseT)
CloneEditable Creates a clone of this class that is editable. A clone is always created, even if this class is already editable.
(Inherited from ImmutableObjectBaseT)
CloneMembersAsEditable Request that member fields be cloned and marked as editable.
(Overrides ImmutableObjectBaseTCloneMembersAsEditable)
CloneReadonly Creates a read-only clone of the object.
(Inherited from ImmutableObjectBaseT)
Contains Determines whether the ICollection contains a specific value.
CopyTo Copies the elements of the ICollection to an Array, starting at a particular Array index.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetEnumeratorReturns an enumerator that iterates through the collection.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IndexOf Determines the index of a specific item in the IListT.
Insert Inserts an item to the IListT at the specified index.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Remove Removes the first occurrence of a specific object from the ICollection.
RemoveAt Removes the IListT item at the specified index.
SetMembersAsReadOnly Requests that member fields be set to "read-only".
(Overrides ImmutableObjectBaseTSetMembersAsReadOnly)
TestForEditable Test if the class has been marked as read-only. Throws an exception if editing cannot occur.
(Inherited from ImmutableObjectBaseT)
ToStringReturns a string that represents the current object.
(Inherited from Object)

Extension Methods

ReplaceFirstNullOrAddT Replaces the first null element in the list with the specified item, or adds the item to the end of the list if no null elements are found.
(Defined by ListExtensions)

See Also