|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
Provides an abstract implementation of the Foley.Utilities.Collections.IList2 interface and extends Foley.Utilities.Collections.Collection2Base.
The main purpose of this is an all purpose base class that can be extended by any class that wants to be a list.
Constructor Summary | |
---|---|
List2Base() Protected constructor for abstract class. |
Property Summary | |
---|---|
object |
Item[int index] Gets or sets the System.Object at the specified index. In C#, this property is the indexer for the list. |
Properties inherited from class Foley.Utilities.Collections.Collection2Base |
---|
Count, IsEmpty, IsFixedSize, IsReadOnly, IsSynchronized, SyncRoot |
Method Summary | |
---|---|
int |
Add(object value) When implemented by a class, adds an System.Object to the list. |
bool |
Add(System.Collections.ICollection collection) Adds the elements of the specified System.Collections.ICollection to the list. |
bool |
Contains(object value) Determines whether the specified System.Object is in the list. |
bool |
Contains(System.Collections.ICollection collection) Determines whether all the elements in the specified System.Collections.ICollection are contained in the list. |
System.Collections.IEnumerator |
GetEnumerator(int index) When implemented by a class, returns an System.Collections.IEnumerator that can iterate through the list that starts at the specified position. |
void |
IList.Insert(int index, object value) This method provided for backwards compatiblity with IList. |
void |
IList.Remove(object value) This method provided for backwards compatiblity with System.Collections.IList. |
void |
IList.RemoveAt(int index) This method provided for backwards compatiblity with System.Collections.IList. |
int |
IndexOf(object value) When implemented by a class, searches for the specified System.Object and returns the zero-based index of the first occurrence within the list. |
bool |
Insert(int index, System.Collections.ICollection collection) When implemented by a class, inserts the elements of the System.Collections.ICollection to the list starting at the specified position. |
bool |
Insert(int index, object value) When implemented by a class, inserts the System.Object specified into the list at the specified position. |
int |
LastIndexOf(object value) When implemented by a class, determines the index of the last occurrence of the specified System.Object in the list. |
bool |
Remove(System.Collections.ICollection collection) Removes the first occurrence of each element of the specified System.Collections.ICollection from the list. |
bool |
Remove(int index, int count) When implemented by a class, removes the specified number of the elements starting at the position specified. |
bool |
Remove(object value) When implemented by a class, removes the first occurrence of a specific System.Object from the list. |
bool |
RemoveAt(int index) When implemented by a class, removes the element at the specified position from the list. |
bool |
Retain(System.Collections.ICollection collection) Retains the first occurrence of each element of the specified System.Collections.ICollection from the list. |
System.Collections.IList |
SubList(int index, int count) When implemented by a class, provides a view of the list with the specified number of the elements starting at the position specified. |
Methods inherited from class Foley.Utilities.Collections.Collection2Base |
---|
Clear, CopyTo, GetEnumerator, IsContainedIn |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Constructor Detail |
---|
protected List2Base()
Protected constructor for abstract class.
Property Detail |
---|
public object this[int index]
Gets or sets the System.Object at the specified index. In C#, this property is the indexer for the list.
Parameters:
index
-
The zero-based index of the element to get or set.
Method Detail |
---|
public int Add(object value)
When implemented by a class, adds an System.Object to the list.
Parameters:
value
-
The System.Object to be added to the end of the list.
public bool Add(System.Collections.ICollection collection)
Adds the elements of the specified System.Collections.ICollection to the list.
Parameters:
collection
-
The System.Collections.ICollection whose elements are added to the list.
System.NullReferenceException
-
The collection is a null reference
(Nothing in Visual Basic).
public bool Contains(object value)
Determines whether the specified System.Object is in the list.
This method determines equality by calling System.Object.Equals(System.Object). Keep in mind that the System.Object to locate can be a null reference (Nothing in Visual Basic). If you do not want this behaviour you must override this method.
Parameters:value
-
The System.Object to check if it is contained in the list.
public bool Contains(System.Collections.ICollection collection)
Determines whether all the elements in the specified System.Collections.ICollection are contained in the list.
This method determines equality by calling System.Object.Equals(System.Object). Keep in mind that the System.Object to locate can be a null reference (Nothing in Visual Basic). If you do not want this behaviour you must override this method.
Parameters:collection
-
The System.Collections.ICollection whose elements are to be checked if
all of its elements are contained in the list.
System.NullReferenceException
-
The collection is a null reference
(Nothing in Visual Basic).
public System.Collections.IEnumerator GetEnumerator(int index)
When implemented by a class, returns an System.Collections.IEnumerator that can iterate through the list that starts at the specified position.
Parameters:
index
-
Starting index in the list for the begining of
the System.Collections.IEnumerator.
private void IList.Insert(int index, object value)
This method provided for backwards compatiblity with IList.
private void IList.Remove(object value)
This method provided for backwards compatiblity with System.Collections.IList.
private void IList.RemoveAt(int index)
This method provided for backwards compatiblity with System.Collections.IList.
public int IndexOf(object value)
When implemented by a class, searches for the specified System.Object and returns the zero-based index of the first occurrence within the list.
Parameters:
value
-
The System.Object to locate in the list.
public bool Insert(int index, System.Collections.ICollection collection)
When implemented by a class, inserts the elements of the System.Collections.ICollection to the list starting at the specified position.
Parameters:
index
-
The zero-based index at which collection should
be inserted.
collection
-
The System.Collections.ICollection whose elements are to be added to
the list.
System.NotSupportedException
- The list is read-only.
-or-The list has a fixed size.
public bool Insert(int index, object value)
When implemented by a class, inserts the System.Object specified into the list at the specified position.
This method hides the System.Collections.IList.Insert(System.Int32,System.Object) method. It is recommened that you do an explicit interface method implementation for complete compatibility.
Parameters:index
-
The zero-based index at which the
System.Object should be inserted.
value
-
The System.Object to insert into the list.
System.NotSupportedException
- The list is read-only.
-or-The list has a fixed size.
public int LastIndexOf(object value)
When implemented by a class, determines the index of the last occurrence of the specified System.Object in the list.
Parameters:
value
-
The System.Object to locate in the list.
public bool Remove(System.Collections.ICollection collection)
Removes the first occurrence of each element of the specified System.Collections.ICollection from the list.
Parameters:
collection
-
The System.Collections.ICollection used to determine what
elements to remove from the list.
System.NotSupportedException
- The list is read-only.
-or-The list has a fixed size.
public bool Remove(int index, int count)
When implemented by a class, removes the specified number of the elements starting at the position specified.
Parameters:
index
-
Starting index for removing elements from the
list.
count
-
The number of elements to remove from the list.
System.NotSupportedException
- The list is read-only.
-or-The list has a fixed size.
public bool Remove(object value)
When implemented by a class, removes the first occurrence of a specific System.Object from the list.
Parameters:
value
-
The System.Object to remove from the list.
public bool RemoveAt(int index)
When implemented by a class, removes the element at the specified position from the list.
Parameters:
index
-
The index of the element to remove from the
list.
System.NotSupportedException
- The list is read-only.
-or-The list has a fixed size.
public bool Retain(System.Collections.ICollection collection)
Retains the first occurrence of each element of the specified System.Collections.ICollection from the list.
Parameters:
collection
-
The System.Collections.ICollection used to determine what
elements to be retained in the list.
System.NotSupportedException
- The list is read-only.
-or-The list has a fixed size.
public System.Collections.IList SubList(int index, int count)
When implemented by a class, provides a view of the list with the specified number of the elements starting at the position specified.
The list that is returned is just a view, it is still backed by the orignal list. Any changes you make to it will be reflected in the orignal list.
Parameters:index
-
Starting index for the view of elements from
the list.
count
-
The number of elements to include in the view of the list.
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |