Class SynchronizedSimpleList<TObject>
Implementation of a thread-safe single-linked list.
Implements
Inherited Members
Namespace: EPiServer.BaseLibrary.Collections
Assembly: EPiServer.BaseLibrary.dll
Version: 8.11.0Syntax
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 |
|
Overrides
Methods
Clear()
Clears this instance.
Declaration
public override void Clear()
Overrides
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
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
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
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
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.