Class TransformationCollection
Collection of ITransformation objects.
Inheritance
Namespace: TreeProblemFramework.Description.Transformations
Properties
Count
Gets the number of ITransformation objects in the collection.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The number of ITransformation objects in the collection. |
Methods
Add(ITransformation)
Method that adds an ITransformation object to the collection only if there is no other one with the same title.
Declaration
public void Add(ITransformation transformation)
Parameters
| Type | Name | Description |
|---|---|---|
| ITransformation | transformation | The ITransformation object to be added. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when one or more required
arguments are |
| TreeProblemFramework.Exceptions.TransformationAlreadyExistsException | Thrown if the title of the specified ITransformation is already associated to an ITransformation object in the collection. |
AddRange(IEnumerable<ITransformation>)
Method that adds a range of ITransformation objects to the collection.
Declaration
public void AddRange(IEnumerable<ITransformation> transformations)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<ITransformation> | transformations | The range of ITransformation objects to be added. |
Remarks
This method calls Add(ITransformation) on each ITransformation in the specified range.
Contains(String)
Method that checks whether the collection contains a transformation with the specified title.
Declaration
public bool Contains(string transformationTitle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | transformationTitle | The transformation title for which to check its existence. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the collection contains a transformation with the specified title, false if it does not. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when one or more required arguments are null. |
GetTitles()
Gets the titles of the ITransformation objects in the collection.
Declaration
public IEnumerable<string> GetTitles()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.String> | An enumerator that yields the titles of the ITransformation objects in the collection. |
Remove(String)
Method that removes the ITransformation object with the specified title from the collection.
Declaration
public void Remove(string transformationTitle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | transformationTitle | The title of the ITransformation object to be removed. |
Retrieve(String)
Method that returns the ITransformation object with the specified title.
Declaration
public ITransformation Retrieve(string transformationTitle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | transformationTitle | The title of the ITransformation to retrieve. |
Returns
| Type | Description |
|---|---|
| ITransformation | An instance of the ITransformation class. |
Exceptions
| Type | Condition |
|---|---|
| TreeProblemFramework.Exceptions.TransformationDoesNotExistException | Thrown when the specified title is not associated to any ITransformation object in the collection. |