Class CompositionOrderedSet<T>
- Namespace
- NMF.Models.Collections
- Assembly
- NMF.Models.dll
Denotes the base class for a composition realized as ordered set
public class CompositionOrderedSet<T> : OrderedSet<T>, IList, ICollection, IOrderedSet<T>, IList<T>, ISet<T>, ICollection<T>, IEnumerable<T>, IEnumerable where T : class, IModelElement
Type Parameters
TThe type of elements
- Inheritance
-
DecoratedSet<T>OrderedSet<T>CompositionOrderedSet<T>
- Implements
-
IOrderedSet<T>IList<T>ISet<T>ICollection<T>IEnumerable<T>
- Inherited Members
Constructors
CompositionOrderedSet(ModelElement)
Create new instance
public CompositionOrderedSet(ModelElement parent)
Parameters
parentModelElementThe parent model element
Exceptions
- ArgumentNullException
Thrown if parent is null
Properties
Parent
Gets the parent model element
public ModelElement Parent { get; }
Property Value
Methods
Add(T)
Adds an element to the current set and returns a value to indicate if the element was successfully added.
public override bool Add(T item)
Parameters
itemTThe element to add to the set.
Returns
Clear()
Removes all items from the ICollection<T>.
public override void Clear()
Exceptions
- NotSupportedException
The ICollection<T> is read-only.
Insert(int, T)
Inserts an item to the IList<T> at the specified index.
public override void Insert(int index, T item)
Parameters
indexintThe zero-based index at which
itemshould be inserted.itemTThe object to insert into the IList<T>.
Exceptions
- ArgumentOutOfRangeException
indexis not a valid index in the IList<T>.- NotSupportedException
The IList<T> is read-only.
Remove(T, int)
Removes the given item at the given arrayIndex
protected override bool Remove(T item, int index)
Parameters
itemTThe item to remove
indexintThe arrayIndex of the item
Returns
- bool
True, if the removal was successful, otherwise false
Replace(int, T, T)
Replaces the item at the given arrayIndex
protected override void Replace(int index, T oldValue, T newValue)
Parameters
indexintThe arrayIndex on which the item is replaced
oldValueTThe old value
newValueTThe new value