Class LemonArraySegment<T>
Inherited Members
Namespace: RedLoader
Assembly: RedLoader.dll
Syntax
public class LemonArraySegment<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
LemonArraySegment(T[])
Initializes a new instance of the LemonArraySegment<T> structure that delimits all the elements in the specified array.
Declaration
public LemonArraySegment(T[] array)
Parameters
| Type | Name | Description |
|---|---|---|
| T[] | array | The array to wrap. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
LemonArraySegment(T[], int, int)
Initializes a new instance of the LemonArraySegment<T> structure that delimits the specified range of the elements in the specified array.
Declaration
public LemonArraySegment(T[] array, int offset, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| T[] | array | The array containing the range of elements to delimit. |
| int | offset | The zero-based index of the first element in the range. |
| int | count | The number of elements in the range. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentOutOfRangeException |
|
| ArgumentException |
|
Properties
Array
Gets the original array containing the range of elements that the array segment delimits.
Declaration
public T[] Array { get; }
Property Value
| Type | Description |
|---|---|
| T[] | The original array that was passed to the constructor, and that contains the range delimited by the LemonArraySegment<T>. |
Count
Gets the number of elements in the range delimited by the array segment.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int | The number of elements in the range delimited by the LemonArraySegment<T>. |
Offset
Gets the position of the first element in the range delimited by the array segment, relative to the start of the original array.
Declaration
public int Offset { get; }
Property Value
| Type | Description |
|---|---|
| int | The position of the first element in the range delimited by the LemonArraySegment<T>, relative to the start of the original array. |
Methods
Equals(LemonArraySegment<T>)
Determines whether the specified LemonArraySegment<T> structure is equal to the current instance.
Declaration
public bool Equals(LemonArraySegment<T> obj)
Parameters
| Type | Name | Description |
|---|---|---|
| LemonArraySegment<T> | obj | The structure to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified LemonArraySegment<T> structure is equal to the current instance; otherwise, false. |
Equals(object)
Determines whether the specified object is equal to the current instance.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to be compared with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is a LemonArraySegment<T> structure and is equal to the current instance; otherwise, false. |
Overrides
GetHashCode()
Returns the hash code for the current instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer hash code. |
Overrides
Operators
operator ==(LemonArraySegment<T>, LemonArraySegment<T>)
Indicates whether two LemonArraySegment<T> structures are equal.
Declaration
public static bool operator ==(LemonArraySegment<T> a, LemonArraySegment<T> b)
Parameters
| Type | Name | Description |
|---|---|---|
| LemonArraySegment<T> | a | The structure on the left side of the equality operator. |
| LemonArraySegment<T> | b | The structure on the right side of the equality operator. |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(LemonArraySegment<T>, LemonArraySegment<T>)
Indicates whether two LemonArraySegment<T> structures are unequal.
Declaration
public static bool operator !=(LemonArraySegment<T> a, LemonArraySegment<T> b)
Parameters
| Type | Name | Description |
|---|---|---|
| LemonArraySegment<T> | a | The structure on the left side of the inequality operator. |
| LemonArraySegment<T> | b | The structure on the right side of the inequality operator. |
Returns
| Type | Description |
|---|---|
| bool |