IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Sorted list of unique items. It is guaranteed that at all times the list of containing items is sorted. More...
Public Member Functions | |
SortedUniqueItemList () | |
Creates an empty sorted list of items with the default capacity. More... | |
SortedUniqueItemList (int initialCapacity) | |
Creates an empty sorted list of items with the specified initial capacity. More... | |
SortedUniqueItemList (params Type[] items) | |
Creates a sorted list of items containing all items from the specified table. More... | |
SortedUniqueItemList (IList< Type > items) | |
Creates a sorted list of items containing all items from the specified list. More... | |
SortedUniqueItemList (ICollection< Type > items) | |
Creates a sorted list of items containing all items from the specified collection. More... | |
Type[] | ToArray () |
Creates and returns an array that cotains elements of the current list, in the actual order. More... | |
void | Clear () |
Removes all elements from the current list. More... | |
bool | Contains (Type item) |
Returns true if the current list contains the specified item, or false otherwise. More... | |
int | IndexOf (Type item) |
Returns index of the specified item on the list, if it exists, otherwise a negative number is returned. NOT thread safe. More... | |
void | AddChecked (Type item) |
Adds the specified element to the list if it is not yet contained in it. If the item is already contained in the list then an exception is thrown. NOT thread safe. More... | |
int | Add (Type item) |
Adds the specified item to the list if it does not yet exist. NOT thread safe. More... | |
void | RemoveChecked (Type item) |
Temoves the item from the list that is equal to the specified item. NOT thread safe. More... | |
int | Remove (Type item) |
Removes the specified item from the list if it exists. NOT thread safe. The object is locked when operation is performed. More... | |
void | Add (Type[] items) |
Adds the specified table of items to the current list. Items are added one by one, which is not the most efficient. The object is locked when operation is performed. More... | |
void | Add (IList< Type > items) |
Adds the specified list of items to the current list. Items are added one by one, which is not the most efficient. More... | |
void | Add (ICollection< Type > items) |
Adds the specified collection of items to the current list. Items are added one by one, which is not the most efficient. The object is locked when operation is performed. More... | |
override string | ToString () |
Returns string representation of this sorted list. More... | |
Protected Member Functions | |
void | Sort () |
Sorts the internal list of items. NOT thread safe. More... | |
Properties | |
object | Lock [get] |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More... | |
Type | this[int index] [get] |
Gets the specified element. More... | |
int | Length [get] |
Gets the current number of elements in the list. More... | |
int | Capacity [get, protected set] |
Gets the current number of elements in the list. More... | |
int | CapacityOverhead [get, set] |
Overhead in capacity. If differnt than 0 then when current capacity is filled, adding operations will perform resizing in such a way that this number of elements are unoccupied. In this way, the frequency of resizes is reduced. Also, removing operations can perform downsizing if the number of free elements after removal is greater than CapacityOverhead (dependent on value of the PerformDownSizing flag). More... | |
bool | PerformDownSizing [get, protected set] |
Flag specifying whether capacity can be reduced on removal operations which would generate large excess of list capacity with respect to the number of actual elements contained in the list. More... | |
IComparer< Type > | Comparer [get, set] |
Gets or sets the comparer. If a new comparer is set then re-sorting of the list is performed. Setter is thread safe, but getter is not. More... | |
![]() | |
object | Lock [get] |
Private Attributes | |
object | _mainLock = new object() |
List< Type > | _list |
int | _capacityOverhead = 0 |
bool | _performDownSizing = false |
IComparer< Type > | _comparer |
Sorted list of unique items. It is guaranteed that at all times the list of containing items is sorted.
Type | Type of items stored in the list. |
$A Igor Dec08 Aug09;
|
inline |
Creates an empty sorted list of items with the default capacity.
|
inline |
Creates an empty sorted list of items with the specified initial capacity.
initialCapacity | Initial capacity of the list. |
|
inline |
Creates a sorted list of items containing all items from the specified table.
items | Table fo items that are added to the created list. |
|
inline |
Creates a sorted list of items containing all items from the specified list.
items | List fo items that are added to the created list. |
|
inline |
Creates a sorted list of items containing all items from the specified collection.
items | Collection fo items that are added to the created list. |
|
inline |
Creates and returns an array that cotains elements of the current list, in the actual order.
|
inline |
Removes all elements from the current list.
|
inlineprotected |
Sorts the internal list of items. NOT thread safe.
|
inline |
Returns true if the current list contains the specified item, or false otherwise.
item | Item whose presence is checked. |
Referenced by IG.Script.LoadableScriptShellNeuralIT.CenterPoint(), IG.Neural.NeuralNetworks.Example3D(), IG.Neural.NeuralTadej.ExampleCasting(), IG.Neural.NeuralTadej.ExampleQuadratic(), IG.Num.NeuralApproximatorBase.ExampleQuadratic(), IG.Neural.NeuralTadej.ExampleStore(), IG.Script.LoadableScriptShellNeuralIT.GetTrainingFromApproximator(), IG.Script.LoadableScriptShellNeuralIT.GetVerificationFromApproximator(), IG.Script.S_12_02_paper_neural_process_chain_model.PlotTrainingAndVerificationPointsResponse(), IG.Script.S_12_01_Paper_NeuralOptCasting_00.PlotTrainingAndVerificationPointsResponse(), IG.Script.LoadableScriptShellNeuralIT.PlotTrainingError(), IG.Script.S_12_02_paper_neural_process_chain_model.PlotVerificationPointsResponse(), IG.Neural.Forms.Old.NeuralParametricDemoOldCopy.PrepareTrainingAndVerificationData(), IG.Neural.Forms.Old.NeuralParametricDemoOld.PrepareTrainingAndVerificationData(), IG.Script.LoadableScriptShellNeuralITOriginalBase.TrainANN(), and IG.Script.LoadableScriptShellNeuralBase.TrainANN().
|
inline |
Returns index of the specified item on the list, if it exists, otherwise a negative number is returned. NOT thread safe.
item | Item that is searched for. |
When the returned value is negative (the item is not contained in the list), then its negative value can be directly used to predict on which place the specified item would be inserted in the list.
|
inline |
Adds the specified element to the list if it is not yet contained in it. If the item is already contained in the list then an exception is thrown. NOT thread safe.
item | Item to be added to the list. For reference types, a reference is added. |
ArgumentException | Throws when an item equal to the specified item (according to the specified comparison operator) already exists on the list. |
Use the Add() method for safe addition (does not throw an exception if the specified item is already contained in the list).
|
inline |
Adds the specified item to the list if it does not yet exist. NOT thread safe.
item | Item to be added to the list. |
Referenced by IG.Num.NeuralApproximatorBase.SetTrainingAndVerificationData().
|
inline |
Temoves the item from the list that is equal to the specified item. NOT thread safe.
item | Item to be removed. |
InvalidOperationException | Throws when the specified item to be removed does not exist on the list. |
Use the Remove() method for safe removal (does not throw exception ehen the specified item does not exist).
|
inline |
Removes the specified item from the list if it exists. NOT thread safe. The object is locked when operation is performed.
item | Item to be removed, found by comparision operations, takes into account that list is sorted. |
|
inline |
Adds the specified table of items to the current list. Items are added one by one, which is not the most efficient. The object is locked when operation is performed.
items | Table containg items to be added. |
|
inline |
Adds the specified list of items to the current list. Items are added one by one, which is not the most efficient.
items | List containg items to be added. |
|
inline |
Adds the specified collection of items to the current list. Items are added one by one, which is not the most efficient. The object is locked when operation is performed.
items | Collection containg items to be added. |
|
inline |
Returns string representation of this sorted list.
|
private |
|
private |
|
private |
|
private |
|
private |
|
get |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.
|
get |
Gets the specified element.
index | Index of the element. |
|
get |
Gets the current number of elements in the list.
Referenced by IG.Lib.IndexListDto.CopyFromPlain(), IG.Num.SampledDataSet.ExtractFilteredData(), IG.Script.S_12_02_paper_neural_process_chain_model.PlotTrainingAndVerificationPointsResponse(), IG.Script.S_12_02_paper_neural_process_chain_model.PlotVerificationError(), IG.Script.LoadableScriptShellNeuralIT.PlotVerificationError(), and IG.Script.S_12_02_paper_neural_process_chain_model.PlotVerificationPointsResponse().
|
getprotected set |
Gets the current number of elements in the list.
Setter is protected.
|
getset |
Overhead in capacity. If differnt than 0 then when current capacity is filled, adding operations will perform resizing in such a way that this number of elements are unoccupied. In this way, the frequency of resizes is reduced. Also, removing operations can perform downsizing if the number of free elements after removal is greater than CapacityOverhead (dependent on value of the PerformDownSizing flag).
|
getprotected set |
Flag specifying whether capacity can be reduced on removal operations which would generate large excess of list capacity with respect to the number of actual elements contained in the list.
If the flag is true then downsizing will occur when the capacity exceeds number of items by twice the CapacityOverhead. Downsizing does not Occur if CapacityOverhead is 0.
|
getset |
Gets or sets the comparer. If a new comparer is set then re-sorting of the list is performed. Setter is thread safe, but getter is not.