SortableList Class |
Namespace: Pathfinding
[SerializableAttribute] public class SortableList : IList, ICollection, IEnumerable, ICloneable
The SortableList type exposes the following members.
Name | Description | |
---|---|---|
SortableList |
Default constructor.
Since no IComparer is provided here, added objects must implement the IComparer interface.
| |
SortableList(IComparer) |
Constructor.
| |
SortableList(Int32) |
Constructor.
Since no IComparer is provided, added objects must implement the IComparer interface.
| |
SortableList(IComparer, Int32) |
Constructor.
|
Name | Description | |
---|---|---|
AddDuplicates |
If set to true, it will not be possible to add an object to the list if its value is already in the list.
| |
Capacity |
Idem ArrayList | |
Count |
IList.ICollection implementation.
Idem ArrayList | |
IsFixedSize |
IList implementation.
Idem ArrayList | |
IsReadOnly |
IList implementation.
Idem ArrayList | |
IsSorted |
'Get only' property that indicates if the list is sorted.
| |
IsSynchronized |
IList.ICollection implementation.
Idem ArrayList | |
Item |
IList implementation.
Gets - or sets - object's value at a specified index.
The set operation is impossible if the KeepSorted property is set to true.
| |
KeepSorted |
Get : Indicates if the list must be kept sorted from now on.
Set : Tells the list if it must stay sorted or not. Impossible to set to true if the list is not sorted.
KeepSorted==true implies that IsSorted==true
| |
SyncRoot |
IList.ICollection implementation.
Idem ArrayList |
Name | Description | |
---|---|---|
Add |
IList implementation.
If the KeepSorted property is set to true, the object will be added at the right place.
Else it will be added at the end of the list.
| |
AddRange |
If the KeepSorted property is set to true, the object will be added at the right place.
Else it will be appended to the list.
| |
Clear |
IList implementation.
Idem ArrayList | |
Clone |
ICloneable implementation.
Idem ArrayList | |
Contains |
IList implementation.
Search for a specified object in the list.
If the list is sorted, a BinarySearch is performed using IComparer interface.
Else the Object.Equals implementation is used.
| |
CopyTo |
IList.ICollection implementation.
Idem ArrayList | |
Equals |
Object.Equals() override.
(Overrides ObjectEquals(Object).) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetEnumerator |
IList.IEnumerable implementation.
Idem ArrayList | |
GetHashCode |
Object.GetHashCode() override.
(Overrides ObjectGetHashCode.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IndexOf(Object) |
IList implementation.
Returns the index of the specified object in the list.
If the list is sorted, a BinarySearch is performed using IComparer interface.
Else the Object.Equals implementation of objects is used.
| |
IndexOf(Object, SortableListEquality) |
Idem IndexOf(object), but with a specified equality function
| |
IndexOf(Object, Int32) |
Idem IndexOf(object), but starting at a specified position in the list
| |
IndexOf(Object, Int32, SortableListEquality) |
Idem IndexOf(object), but with a start index and a specified equality function
| |
IndexOfMax |
Returns the object of the list whose value is maximum
| |
IndexOfMin |
Returns the object of the list whose value is minimum
| |
Insert |
IList implementation.
Inserts an objects at a specified index.
Cannot be used if the list has its KeepSorted property set to true.
| |
InsertRange |
Inserts a collection of objects at a specified index.
Should not be used if the list is the KeepSorted property is set to true.
| |
LimitNbOccurrences |
Limits the number of occurrences of a specified value.
Same values are equals according to the Equals() method of objects in the list.
The first occurrences encountered are kept.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Remove |
IList implementation.
Idem ArrayList | |
RemoveAt |
IList implementation.
Idem ArrayList | |
RemoveDuplicates |
Removes all duplicates in the list.
Each value encountered will have only one representant.
| |
Sort |
Sorts the elements in the list using ArrayList.Sort.
Does nothing if the list is already sorted.
| |
ToString |
Object.ToString() override.
Build a string to represent the list.
(Overrides ObjectToString.) |