C# Класс com.calitha.commons.IntegerList

A type-safe list of integers.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( int value ) : int

Adds an integer to a list.

Clear ( ) : void

Removes all elements from the list.

Clone ( ) : object

A shallow copy of the list.

Contains ( int value ) : bool
CopyTo ( Array array ) : void

Copies the entire list to a compatible one-dimensional array, starting at the beginning of the target array.

CopyTo ( Array array, int arrayIndex ) : void

Copies the entire list to a compatible one-dimensional Array, starting at the specified index of the target array.

CopyTo ( int index, Array array, int arrayIndex, int count ) : void

Copies a range of elements from the list to a compatible one-dimensional Array, starting at the specified index of the target array.

Equals ( object obj ) : bool

Determines whether the specified Object is equal to the current Object.

Equals ( object objA, object objB ) : bool

Determines whether the specified Object instances are considered equal.

GetEnumerator ( ) : IEnumerator

Returns an enumerator for the entire list.

GetEnumerator ( int index, int count ) : IEnumerator

Returns an enumerator for a section of the ArrayList.

GetHashCode ( ) : int

Serves as a hash function.

GetRange ( int index, int count ) : IntegerList

Returns an integer list which represents a subset of the elements in the source list.

IndexOf ( int value ) : int

Searches for the specified Object and returns the zero-based index of the first occurrence within the entire list.

IndexOf ( int value, int startIndex ) : int

Searches for the specified Object and returns the zero-based index of the first occurrence within the section of the ArrayList that extends from the specified index to the last element.

IndexOf ( int value, int startIndex, int count ) : int

Searches for the specified Object and returns the zero-based index of the first occurrence within the section of the list that starts at the specified index and contains the specified number of elements.

Insert ( int index, int value ) : void

Inserts an element into the list at the specified index.

InsertRange ( int index, IntegerList other ) : void

Inserts the elements of the other integer list into the list at the specified index.

IntegerList ( ) : System

Creates a new integer list.

LastIndexOf ( int value ) : int

Searches for the specified value and returns the zero-based index of the last occurrence within the entire list.

LastIndexOf ( int value, int startIndex ) : int

Searches for the specified value and returns the zero-based index of the last occurrence within the section of the list that extends from the first element to the specified index

LastIndexOf ( int value, int startIndex, int count ) : int

Searches for the specified value and returns the zero-based index of the last occurrence within the section of the list that contains the specified number of elements and ends at the specified index.

Remove ( int value ) : void

Removes the first occurrence of a specific value from the list.

RemoveAt ( int index ) : void

Removes the element at the specified index of the list.

RemoveRange ( int index, int count ) : void

Removes a range of elements from the list.

Repeat ( int value, int count ) : IntegerList

Returns an IntegerList whose elements are copies of the specified value.

Reverse ( ) : void

Reverses the order of the elements in the entire list.

Reverse ( int index, int count ) : void

Reverses the order of the elements in the specified range.

SetRange ( int index, IntegerList otherList ) : void

Copies the elements of a collection over a range of elements in the list.

Sort ( ) : void

Sorts the elements in the entire list using the IComparable implementation of the Integer.

Sort ( IComparer comparer ) : void

Sorts the elements in the entire ArrayList using the specified comparer.

Sort ( int index, int count, IComparer comparer ) : void

Sorts the elements in a section of the list using the specified comparer.

Synchronized ( IntegerList list ) : IntegerList

Returns an IntegerList wrapper that is synchronized.

ToString ( ) : string

Returns a String that represents the list.

TrimToSize ( ) : void

Sets the capacity to the actual number of elements in the list.

this ( int index ) : int

Gets a value from the list.

Описание методов

Add() публичный Метод

Adds an integer to a list.
public Add ( int value ) : int
value int The value that will be added.
Результат int

Clear() публичный Метод

Removes all elements from the list.
public Clear ( ) : void
Результат void

Clone() публичный Метод

A shallow copy of the list.
public Clone ( ) : object
Результат object

Contains() публичный Метод

public Contains ( int value ) : bool
value int
Результат bool

CopyTo() публичный Метод

Copies the entire list to a compatible one-dimensional array, starting at the beginning of the target array.
public CopyTo ( Array array ) : void
array Array The one-dimensional Array that is the destination /// of the elements copied from the list. /// The Array must have zero-based indexing.
Результат void

CopyTo() публичный Метод

Copies the entire list to a compatible one-dimensional Array, starting at the specified index of the target array.
public CopyTo ( Array array, int arrayIndex ) : void
array Array The one-dimensional Array that is the destination /// of the elements copied from ArrayList. /// The Array must have zero-based indexing.
arrayIndex int The zero-based index in array at which /// copying begins.
Результат void

CopyTo() публичный Метод

Copies a range of elements from the list to a compatible one-dimensional Array, starting at the specified index of the target array.
public CopyTo ( int index, Array array, int arrayIndex, int count ) : void
index int The zero-based index in the source list at which copying begins.
array Array The one-dimensional Array that is the destination of /// the elements copied from the list. The Array must have zero-based indexing.
arrayIndex int The zero-based index in array at which copying begins.
count int The number of elements to copy.
Результат void

Equals() публичный Метод

Determines whether the specified Object is equal to the current Object.
public Equals ( object obj ) : bool
obj object The Object to compare with the current Object.
Результат bool

Equals() публичный статический Метод

Determines whether the specified Object instances are considered equal.
public static Equals ( object objA, object objB ) : bool
objA object The first Object to compare.
objB object The second Object to compare.
Результат bool

GetEnumerator() публичный Метод

Returns an enumerator for the entire list.
public GetEnumerator ( ) : IEnumerator
Результат IEnumerator

GetEnumerator() публичный Метод

Returns an enumerator for a section of the ArrayList.
public GetEnumerator ( int index, int count ) : IEnumerator
index int The zero-based starting index of the ArrayList section /// that the enumerator should refer to.
count int The number of elements in the ArrayList section that /// the enumerator should refer to
Результат IEnumerator

GetHashCode() публичный Метод

Serves as a hash function.
public GetHashCode ( ) : int
Результат int

GetRange() публичный Метод

Returns an integer list which represents a subset of the elements in the source list.
public GetRange ( int index, int count ) : IntegerList
index int The zero-based list index at which the range starts.
count int The number of elements in the range.
Результат IntegerList

IndexOf() публичный Метод

Searches for the specified Object and returns the zero-based index of the first occurrence within the entire list.
public IndexOf ( int value ) : int
value int The value to locate in the list.
Результат int

IndexOf() публичный Метод

Searches for the specified Object and returns the zero-based index of the first occurrence within the section of the ArrayList that extends from the specified index to the last element.
public IndexOf ( int value, int startIndex ) : int
value int The value to locate in the list.
startIndex int The zero-based starting index of the search.
Результат int

IndexOf() публичный Метод

Searches for the specified Object and returns the zero-based index of the first occurrence within the section of the list that starts at the specified index and contains the specified number of elements.
public IndexOf ( int value, int startIndex, int count ) : int
value int The value to locate in the list.
startIndex int The zero-based starting index of the search.
count int The number of elements in the section to search.
Результат int

Insert() публичный Метод

Inserts an element into the list at the specified index.
public Insert ( int index, int value ) : void
index int The zero-based index at which value should be inserted.
value int The value to insert.
Результат void

InsertRange() публичный Метод

Inserts the elements of the other integer list into the list at the specified index.
public InsertRange ( int index, IntegerList other ) : void
index int The zero-based index at which the new elements should be inserted.
other IntegerList The other list whose elements should be inserted into the list.
Результат void

IntegerList() публичный Метод

Creates a new integer list.
public IntegerList ( ) : System
Результат System

LastIndexOf() публичный Метод

Searches for the specified value and returns the zero-based index of the last occurrence within the entire list.
public LastIndexOf ( int value ) : int
value int The value to locate in the list.
Результат int

LastIndexOf() публичный Метод

Searches for the specified value and returns the zero-based index of the last occurrence within the section of the list that extends from the first element to the specified index
public LastIndexOf ( int value, int startIndex ) : int
value int The value to search for.
startIndex int The zero-based starting index of the backward search.
Результат int

LastIndexOf() публичный Метод

Searches for the specified value and returns the zero-based index of the last occurrence within the section of the list that contains the specified number of elements and ends at the specified index.
public LastIndexOf ( int value, int startIndex, int count ) : int
value int The value to locate in the list.
startIndex int The zero-based starting index of the backward search.
count int The number of elements in the section to search.
Результат int

Remove() публичный Метод

Removes the first occurrence of a specific value from the list.
public Remove ( int value ) : void
value int The value to remove from the list.
Результат void

RemoveAt() публичный Метод

Removes the element at the specified index of the list.
public RemoveAt ( int index ) : void
index int The zero-based index of the element to remove.
Результат void

RemoveRange() публичный Метод

Removes a range of elements from the list.
public RemoveRange ( int index, int count ) : void
index int The zero-based starting index of the range of elements to remove.
count int The number of elements to remove.
Результат void

Repeat() публичный статический Метод

Returns an IntegerList whose elements are copies of the specified value.
public static Repeat ( int value, int count ) : IntegerList
value int The value to copy multiple times in the list.
count int The number of times value should be copied.
Результат IntegerList

Reverse() публичный Метод

Reverses the order of the elements in the entire list.
public Reverse ( ) : void
Результат void

Reverse() публичный Метод

Reverses the order of the elements in the specified range.
public Reverse ( int index, int count ) : void
index int The zero-based starting index of the range to reverse.
count int The number of elements in the range to reverse.
Результат void

SetRange() публичный Метод

Copies the elements of a collection over a range of elements in the list.
public SetRange ( int index, IntegerList otherList ) : void
index int The zero-based index at which to start copying the elements /// of otherList
otherList IntegerList The other list whose elements to copy to the list.
Результат void

Sort() публичный Метод

Sorts the elements in the entire list using the IComparable implementation of the Integer.
public Sort ( ) : void
Результат void

Sort() публичный Метод

Sorts the elements in the entire ArrayList using the specified comparer.
public Sort ( IComparer comparer ) : void
comparer IComparer The IComparer implementation to use when comparing elements.
Результат void

Sort() публичный Метод

Sorts the elements in a section of the list using the specified comparer.
public Sort ( int index, int count, IComparer comparer ) : void
index int The zero-based starting index of the range to sort.
count int The length of the range to sort.
comparer IComparer The IComparer implementation to use when comparing elements.
Результат void

Synchronized() публичный статический Метод

Returns an IntegerList wrapper that is synchronized.
public static Synchronized ( IntegerList list ) : IntegerList
list IntegerList The list to synchronize.
Результат IntegerList

ToString() публичный Метод

Returns a String that represents the list.
public ToString ( ) : string
Результат string

TrimToSize() публичный Метод

Sets the capacity to the actual number of elements in the list.
public TrimToSize ( ) : void
Результат void

this() публичный Метод

Gets a value from the list.
public this ( int index ) : int
index int
Результат int