An implementation of the IVector interface that uses a dynamic array for storing the list elements.
sealed class
|
ArrayVector
|
with
|
<T>
|
||
implements
|
IArrayVector<T>
|
||||
extends
|
VectorBase<T>
|
The number of elements in this collection.
public
override
property
|
Count
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of elements. | |
implements
|
BagConstBase.Count
|
Returns the element array that is used by this list object.
public
property
|
InternalArray
{
get
}
|
||
type
|
T[]
|
||
value
|
The
internal
element
array;
can
be
null
if
Count
returns
0 .
|
||
implements
|
IArrayVector.InternalArray
|
Remarks:
The array length can be greater than the list count. Modifying the contents of the returned array can result in undefined behaviour.
Creates a new instance of ArrayVector.
public
constructor
|
ArrayVector
(EqualsDelegate<T> equals = null,
int32 capacity = 12)
|
||
params
|
equals
|
The equality delegate. | |
capacity
|
[>=0]
|
The
initial
capacity.
Defaults
to
12 . |
Adds the given element to this collection.
public
override
method
|
Add
(T element)
|
||
type
|
bool
|
||
params
|
element
|
The element to add. | |
returns
|
true
if
the
collection
has
changed,
false
if
not. |
||
implements
|
BagBase.Add
|
Remarks:
Implementing
methods
shall
return
false
iff
the
element
has
already
been
collected,
i.e.
it
is
contained
in
the
collection.
If
in
doubt,
return
true
.
Adds the given elements to this collection.
public
method
|
AddAll
(IEnumerable<T> elements)
|
||
type
|
bool
|
||
params
|
elements
|
[not-null]
|
The elements to add. |
returns
|
true
if
the
collection
has
changed,
false
if
not. |
||
inherited
|
BagBase.AddAll
|
Adds the given elements to this collection.
public
override
method
|
AddAll
(T[] elements,
int32 first = 0,
int32 count = -1)
|
||
type
|
bool
|
||
params
|
elements
|
[not-null]
|
The elements to add. |
first
|
[>=0]
|
Index of first element to add. | |
count
|
[>=-1]
|
Number
of
elements
to
add.
If
-1
all
elements
from
first
to
the
last
element
are
added.
|
|
returns
|
true
if
the
collection
has
changed,
false
if
not. |
||
overrides
|
BagBase.AddAll
|
Removes all elements from this collection.
public
override
method
|
Clear
()
|
||
implements
|
BagBase.Clear
|
Removes all elements from this collection, without setting the element values to their defaults.
public
method
|
ClearDirty
()
|
Returns if this collection contains the given element.
[Pure]
|
||||
public
override
method
|
Contains
(T element)
|
|||
type
|
bool
|
|||
params
|
element
|
The element. | ||
returns
|
true
if
element
is
contained
in
this
collection,
false
if
not.
|
|||
inherited
|
VectorBase.Contains
|
Returns if this collection contains all given elements.
public
method
|
ContainsAll
(IEnumerable<T> elements)
|
||
type
|
bool
|
||
params
|
elements
|
[not-null]
|
The elements. |
returns
|
true
if
all
elements
are
contained
in
this
collection,
false
if
not.
|
||
inherited
|
BagConstBase.ContainsAll
|
Compares this object with the given one.
[Pure]
|
||||
public
method
|
Equals
(IVectorConst<T> other)
|
|||
type
|
bool
|
|||
params
|
other
|
The object to compare to. | ||
returns
|
true
if
this
object
is
equal
to
other,
false
if
not.
|
|||
inherited
|
VectorBase.Equals
|
Returns the first enumerated value.
[Pure]
|
||||
public
override
method
|
First
()
|
|||
type
|
T
|
|||
returns
|
The first enumerated value. | |||
inherited
|
VectorBase.First
|
Exceptions:
Returns the element at the given list index.
[Pure]
|
||||
public
override
method
|
GetAt
(int32 index)
|
|||
type
|
T
|
|||
params
|
index
|
[0..Count-1]
|
The list index. | |
returns
|
The element. | |||
implements
|
VectorBase.GetAt
|
public
override
method
|
GetEnumerator
()
|
||
type
|
IEnumerator<T>
|
||
implements
|
EnumerableBase.GetEnumerator
|
Returns the list index of the given element.
[Pure]
|
||||
public
override
method
|
IndexOf
(T element)
|
|||
type
|
int32
|
|||
params
|
element
|
The element. | ||
returns
|
The
list
index
or
-1
if
the
element
is
not
contained
in
the
list. |
|||
implements
|
VectorBase.IndexOf
|
Inserts the given element into the list.
public
override
method
|
InsertAt
(int32 index,
T element)
|
||
params
|
index
|
[0..Count]
|
List index where to insert the element. |
element
|
The element to insert. | ||
implements
|
VectorBase.InsertAt
|
Returns the last enumerated value.
[Pure]
|
||||
public
override
method
|
Last
()
|
|||
type
|
T
|
|||
returns
|
The last enumerated value. | |||
inherited
|
VectorBase.Last
|
Exceptions:
Removes the given element from this collection.
public
override
method
|
Remove
(T element)
|
||
type
|
bool
|
||
params
|
element
|
The element to remove. | |
returns
|
true
if
the
collection
has
changed,
false
if
not. |
||
implements
|
BagBase.Remove
|
Removes the given elements from this collection.
public
method
|
RemoveAll
(IEnumerable<T> elements)
|
||
type
|
bool
|
||
params
|
elements
|
[not-null]
|
The elements to remove. |
returns
|
true
if
the
collection
has
changed,
false
if
not. |
||
inherited
|
BagBase.RemoveAll
|
Removes the element at the given list index.
public
override
method
|
RemoveAt
(int32 index)
|
||
type
|
T
|
||
params
|
index
|
[0..Count-1]
|
The list index. |
returns
|
The removed element. | ||
implements
|
VectorBase.RemoveAt
|
Removes a range of elements.
public
override
method
|
RemoveRange
(int32 index,
int32 count)
|
||
params
|
index
|
[0..Count]
|
List index of first element to remove. |
count
|
[0..Count-index]
|
Number of subsequent elements to remove. | |
implements
|
VectorBase.RemoveRange
|
Removes
all
elements
from
this
collection
for
which
the
given
predicate
evaluates
to
true
.
public
override
method
|
RemoveWhere
(PredicateDelegate<T> predicate)
|
||
type
|
bool
|
||
params
|
predicate
|
[not-null]
|
The predicate to use. |
returns
|
true
if
the
collection
has
changed,
false
if
not. |
||
inherited
|
VectorBase.RemoveWhere
|
Sets the element at the given list index.
public
override
method
|
SetAt
(int32 index,
T element)
|
||
type
|
T
|
||
params
|
index
|
[0..Count-1]
|
The list index of the element to set. |
element
|
The new element. | ||
returns
|
The previous element. | ||
implements
|
VectorBase.SetAt
|
Returns the elements of this enumerable object as a fresh array.
[Pure]
|
||||
public
method
|
ToArray
()
|
|||
type
|
T[]
|
|||
returns
|
|
The array of elements. | ||
inherited
|
BagConstBase.ToArray
|
Returns the elements of this collection as an array.
public
override
method
|
ToArrayCopy
(T[] array,
int32 offset = 0)
|
||
type
|
T[]
|
||
params
|
array
|
[not-null]
|
The output array. |
offset
|
[>=0]
|
Offset
into
array.
Defaults
to
0 .
|
|
returns
|
|
The filled array. | |
implements
|
BagConstBase.ToArrayCopy
|
Remarks:
The elements in this collection will be copied into the given array, starting at the array index specified by offset.
Returns the elements of this enumerable object as a list.
[Pure]
|
||||
public
override
method
|
ToArrayList
()
|
|||
type
|
IArrayVector<T>
|
|||
returns
|
|
The list of elements. | ||
overrides
|
BagConstBase.ToArrayList
|
Returns the elements of this enumerable object as a list.
[Pure]
|
||||
public
override
method
|
ToList
()
|
|||
type
|
IVectorConst<T>
|
|||
returns
|
|
The list of elements. | ||
inherited
|
VectorBase.ToList
|