Class SynchronizedSimpleList<TObject>

Implementation of a thread-safe single-linked list.

Inheritance
System.Object
SimpleList<TObject>
SynchronizedSimpleList<TObject>
Implements
System.Collections.Generic.IList<TObject>
System.Collections.Generic.ICollection<TObject>
System.Collections.Generic.IEnumerable<TObject>
System.Collections.IEnumerable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.BaseLibrary.Collections
Assembly: EPiServer.BaseLibrary.dll
Version: 8.11.0
Syntax
public class SynchronizedSimpleList<TObject> : SimpleList<TObject>, IList<TObject>, ICollection<TObject>, IEnumerable<TObject>, IEnumerable
Type Parameters
Name Description
TObject

The type of the object.

Constructors

SynchronizedSimpleList()

Declaration
public SynchronizedSimpleList()

Properties

IsSynchronized

Gets a value indicating whether this instance is synchronized.

Declaration
public override bool IsSynchronized { get; }
Property Value
Type Description
System.Boolean

true if this instance is synchronized; otherwise, false.

Overrides
EPiServer.BaseLibrary.Collections.SimpleList<TObject>.IsSynchronized

Methods

Clear()

Clears this instance.

Declaration
public override void Clear()
Overrides
EPiServer.BaseLibrary.Collections.SimpleList<TObject>.Clear()

InsertFirst(TObject)

Inserts the item at the start of the list.

Declaration
public override void InsertFirst(TObject item)
Parameters
Type Name Description
TObject item

The item to insert.

Overrides
EPiServer.BaseLibrary.Collections.SimpleList<TObject>.InsertFirst(TObject)
Remarks

This operation is an O(1) operation.

InsertLast(TObject)

Inserts the item at the end of the list.

Declaration
public override void InsertLast(TObject item)
Parameters
Type Name Description
TObject item

The item to insert.

Overrides
EPiServer.BaseLibrary.Collections.SimpleList<TObject>.InsertLast(TObject)
Remarks

This operation is an O(1) operation.

RemoveFirst()

Removes the first item from the list.

Declaration
public override TObject RemoveFirst()
Returns
Type Description
TObject

The removed item. If no item existed it returns null.

Overrides
EPiServer.BaseLibrary.Collections.SimpleList<TObject>.RemoveFirst()
Remarks

This operation is an O(1) operation.

Note that there is no way to distinguish between the case where the list contained an item with the value null versus the case where there was no item to remove. Both cases will return null.

RemoveLast()

Remove last item from the list

Declaration
public override TObject RemoveLast()
Returns
Type Description
TObject

The removed item. If no item existed it returns null.

Overrides
EPiServer.BaseLibrary.Collections.SimpleList<TObject>.RemoveLast()
Remarks

This operation is an O(n) operation where n is the numer of items in the list. If possible this method should be avoided since all other operations on this class are O(1) operations.

Note that there is no way to distinguish between the case where the list contained an item with the value null versus the case where there was no item to remove. Both cases will return null.

Implements

System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods