Interface IList<T>
This is an indexed collection, where the item order is chosen by the user at insertion time.
NBNBNB: we need a description of the view functionality here!
Inherited Members
Namespace: Lucene.Net.Support.C5
Assembly: Lucene.Net.dll
Syntax
public interface IList<T> : IIndexed<T>, ISequenced<T>, ICollection<T>, IExtensible<T>, IDirectedCollectionValue<T>, ICollectionValue<T>, IShowable, IFormattable, IDirectedEnumerable<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IDisposable, IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable
Type Parameters
Name | Description |
---|---|
T |
Properties
| Improve this Doc View SourceCount
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
FIFO
Since
Add(T item)
always add at the end of the list,
this describes if list has FIFO or LIFO semantics.
Declaration
bool FIFO { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the operation removes from the
start of the list, false if it removes from the end.
|
First
Declaration
T First { get; }
Property Value
Type | Description |
---|---|
T | The first item in this list. |
Exceptions
Type | Condition |
---|---|
NoSuchItemException | if this list is empty. |
IsReadOnly
Declaration
bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsValid
Declaration
bool IsValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[Int32]
On this list, this indexer is read/write.
Declaration
T this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the item to fetch or store. |
Property Value
Type | Description |
---|---|
T | The index'th item of this list. |
Exceptions
Type | Condition |
---|---|
System.IndexOutOfRangeException | if index is negative or
|
Last
Declaration
T Last { get; }
Property Value
Type | Description |
---|---|
T | The last item in this list. |
Exceptions
Type | Condition |
---|---|
NoSuchItemException | if this list is empty. |
Offset
Declaration
int Offset { get; }
Property Value
Type | Description |
---|---|
System.Int32 | Offset for this list view or 0 for an underlying list. |
Underlying
Null if this list is not a view.
Declaration
IList<T> Underlying { get; }
Property Value
Type | Description |
---|---|
IList<T> | Underlying list for view. |
Methods
| Improve this Doc View SourceAdd(T)
Declaration
bool Add(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Returns
Type | Description |
---|---|
System.Boolean |
Clear()
Declaration
void Clear()
Contains(T)
Declaration
bool Contains(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Returns
Type | Description |
---|---|
System.Boolean |
CopyTo(T[], Int32)
Declaration
void CopyTo(T[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | |
System.Int32 | index |
FindAll(Func<T, Boolean>)
Create a new list consisting of the items of this list satisfying a certain predicate.
Declaration
IList<T> FindAll(Func<T, bool> filter)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | filter | The filter delegate defining the predicate. |
Returns
Type | Description |
---|---|
IList<T> | The new list. |
IndexOf(T)
Searches for an item in the list going forwards from the start.
Declaration
int IndexOf(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | Item to search for. |
Returns
Type | Description |
---|---|
System.Int32 | Index of item from start. A negative number if item not found, namely the one's complement of the index at which the Add operation would put the item. |
Insert(IList<T>, T)
Insert an item at the end of a compatible view, used as a pointer.
The
pointer
must be a view on the same list as
this
and the endpoint of pointer
must be
a valid insertion point of
this
Declaration
void Insert(IList<T> pointer, T item)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | pointer | |
T | item |
Exceptions
Type | Condition |
---|---|
IncompatibleViewException | If
is not a view on the same list as
|
System.IndexOutOfRangeException | ?????? if the endpoint of is not inside
|
DuplicateNotAllowedException | if the list has and the item is
already in the list. |
InsertAll(Int32, IEnumerable<T>)
Insert into this list all items from an enumerable collection starting at a particular index.
Declaration
void InsertAll(int index, IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index to start inserting at |
System.Collections.Generic.IEnumerable<T> | items | Items to insert |
Exceptions
Type | Condition |
---|---|
System.IndexOutOfRangeException | if is negative or
|
DuplicateNotAllowedException | if the list has and one of the items to insert is
already in the list. |
InsertFirst(T)
Insert an item at the front of this list. DuplicateNotAllowedException if the list has
AllowsDuplicates==false
and the item is
already in the list.
Declaration
void InsertFirst(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item to insert. |
InsertLast(T)
Insert an item at the back of this list. DuplicateNotAllowedException if the list has
AllowsDuplicates==false
and the item is
already in the list.
Declaration
void InsertLast(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item to insert. |
IsSorted()
Check if this list is sorted according to the default sorting order for the item type T, as defined by the C5.Comparer`1 class
Declaration
bool IsSorted()
Returns
Type | Description |
---|---|
System.Boolean | True if the list is sorted, else false. |
Exceptions
Type | Condition |
---|---|
NotComparableException | if T is not comparable |
IsSorted(IComparer<T>)
Check if this list is sorted according to a specific sorting order.
Declaration
bool IsSorted(IComparer<T> comparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IComparer<T> | comparer | The comparer defining the sorting order. |
Returns
Type | Description |
---|---|
System.Boolean | True if the list is sorted, else false. |
LastViewOf(T)
Create a list view on this list containing the last occurrence of a particular item. NoSuchItemException if the item is not in this list.
Declaration
IList<T> LastViewOf(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item to find. |
Returns
Type | Description |
---|---|
IList<T> | The new list view. |
Map<V>(Func<T, V>)
Create a new list consisting of the results of mapping all items of this list. The new list will use the default equalityComparer for the item type V.
Declaration
IList<V> Map<V>(Func<T, V> mapper)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, V> | mapper | The delegate defining the map. |
Returns
Type | Description |
---|---|
IList<V> | The new list. |
Type Parameters
Name | Description |
---|---|
V | The type of items of the new list |
Map<V>(Func<T, V>, IEqualityComparer<V>)
Create a new list consisting of the results of mapping all items of this list. The new list will use a specified equalityComparer for the item type.
Declaration
IList<V> Map<V>(Func<T, V> mapper, IEqualityComparer<V> equalityComparer)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, V> | mapper | The delegate defining the map. |
System.Collections.Generic.IEqualityComparer<V> | equalityComparer | The equalityComparer to use for the new list |
Returns
Type | Description |
---|---|
IList<V> | The new list. |
Type Parameters
Name | Description |
---|---|
V | The type of items of the new list |
Remove()
Remove one item from the list: from the front if
FIFO
is true, else from the back.
NoSuchItemException if this list is empty.
Declaration
T Remove()
Returns
Type | Description |
---|---|
T | The removed item. |
Remove(T)
Declaration
bool Remove(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveAt(Int32)
Remove the item at a specific position of the list.
Declaration
T RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the item to remove. |
Returns
Type | Description |
---|---|
T | The removed item. |
Exceptions
Type | Condition |
---|---|
System.IndexOutOfRangeException | if is negative or
|
RemoveFirst()
Remove one item from the front of the list. NoSuchItemException if this list is empty.
Declaration
T RemoveFirst()
Returns
Type | Description |
---|---|
T | The removed item. |
RemoveLast()
Remove one item from the back of the list. NoSuchItemException if this list is empty.
Declaration
T RemoveLast()
Returns
Type | Description |
---|---|
T | The removed item. |
Reverse()
Reverse the list so the items are in the opposite sequence order.
Declaration
void Reverse()
Shuffle()
Randomly shuffle the items of this list.
Declaration
void Shuffle()
Shuffle(Random)
Shuffle the items of this list according to a specific random source.
Declaration
void Shuffle(Random rnd)
Parameters
Type | Name | Description |
---|---|---|
System.Random | rnd | The random source. |
Slide(Int32)
Slide this list view along the underlying list.
Declaration
IList<T> Slide(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The signed amount to slide: positive to slide towards the end. |
Returns
Type | Description |
---|---|
IList<T> |
Exceptions
Type | Condition |
---|---|
NotAViewException | if this list is not a view. |
System.ArgumentOutOfRangeException | if the operation would bring either end of the view outside the underlying list. |
Slide(Int32, Int32)
Slide this list view along the underlying list, changing its size.
Declaration
IList<T> Slide(int offset, int size)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The signed amount to slide: positive to slide towards the end. |
System.Int32 | size | The new size of the view. |
Returns
Type | Description |
---|---|
IList<T> |
Exceptions
Type | Condition |
---|---|
NotAViewException | if this list is not a view. |
System.ArgumentOutOfRangeException | if the operation would bring either end of the view outside the underlying list. |
Sort()
Sort the items of the list according to the default sorting order for the item type T, as defined by the C5.Comparer`1 class
Declaration
void Sort()
Exceptions
Type | Condition |
---|---|
NotComparableException | if T is not comparable |
Sort(IComparer<T>)
Sort the items of the list according to a specified sorting order.
The sorting does not perform duplicate elimination or identify items according to the comparer or itemequalityComparer. I.e. the list as an unsequenced collection with binary equality, will not change.
Declaration
void Sort(IComparer<T> comparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IComparer<T> | comparer | The comparer defining the sorting order. |
Span(IList<T>)
Returns null if
otherView
is strictly to the left of this view
Declaration
IList<T> Span(IList<T> otherView)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | otherView |
Returns
Type | Description |
---|---|
IList<T> |
Exceptions
Type | Condition |
---|---|
IncompatibleViewException | If otherView does not have the same underlying list as this |
System.ArgumentOutOfRangeException | If is strictly to the left of this view
|
TrySlide(Int32)
Declaration
bool TrySlide(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset |
Returns
Type | Description |
---|---|
System.Boolean |
TrySlide(Int32, Int32)
Declaration
bool TrySlide(int offset, int size)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | |
System.Int32 | size |
Returns
Type | Description |
---|---|
System.Boolean |
View(Int32, Int32)
Create a list view on this list. System.ArgumentOutOfRangeException if the view would not fit into this list.
Declaration
IList<T> View(int start, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | start | The index in this list of the start of the view. |
System.Int32 | count | The size of the view. |
Returns
Type | Description |
---|---|
IList<T> | The new list view. |
ViewOf(T)
Create a list view on this list containing the (first) occurrence of a particular item. NoSuchItemException if the item is not in this list.
Declaration
IList<T> ViewOf(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item to find. |
Returns
Type | Description |
---|---|
IList<T> | The new list view. |