Table of Contents

Class vdArray<T>

Namespace
VectorDraw.Generics
Assembly
VectorDraw.Generics.dll

This is the basic template collection.

public class vdArray<T> : BaseObject, IDisposable, IBaseObject, IEnumerable, IVDSerialise

Type Parameters

T

The type of the objects that the collection will have.

Inheritance
vdArray<T>
Implements
Derived
Inherited Members

Constructors

vdArray()

The default constractor which initializes the default capacity of the collection to 16.

vdArray(int)

Initializes the vdArray object with a given capacity.

vdArray(T[])

Initializes the vdArray object by adding the passed array items.

Properties

ArrayItems

Get the items of the collection in a returned array.

The length of the return collection can be bigger than Count

this is done with the aim of having better performance of memory allocation

Always access to Count items of return collection

Count

Get the number of items in the collection.

Current

Get the current object in the collection.

CurrentIndex

Get the current index of the collection.

this[int]

Get/Set the object at a specified index of the collection.

Methods

AddItem(T)

Adds an object to the end of the collection.

AddRange(vdArray<T>)

Adds the objects of one list to the end of this list.

BeforeLast()

Get the object before the last object of the collection.

ChangeOrder(T, bool)

Places an existing object of the collection to the beginning or the end of the list.

ClearIndexDictionary()

Internally used to speed up Swap method.

Clone()

Creates and returns a new array that is a copy of the current instance.
Items in the new array have the same reference as the ones in the original array.

CopyFrom(object)

Copies all objects from a given array to the collection.

DeSerialize(DeSerializer, string, object)

This Function is called foreach field name of the vdArray object when opening in vdml format.

EnsureCapacity(int)

Changes the capacity of the collection to the given value if the existing capacity is less than this value.

GetEnumerator()

Implements the "foreach" expression for the collection.

GetObjectRealPosition(T)

Find the index where a specified object is located in the list.

InsertAt(int, T)

Insert an object at a specified index.

InsertRange(int, vdArray<T>)

Inserts the object of a specified collection to a specified index of this list.

IsValidIndex(int)

Checks if the given index is in the range of the collection.

IsValidInsertIndex(int)

Checks if the given index can be used with InsertAt(int, T) method.

IsValidRemoveIndex(int)

Checks if the given index is in the range of the collection.

Last()

Get the last object in the collection and changes the current index equal to the size-1 of the collection.

MakeIndexDictionary()

Internally used to speed up Swap method when multiple swap operations must be performed (more than 100). ClearIndexDictionary() method must be called at the end of the swap operations.

Next()

Get the next object of the collection and also increases the current index of the collection.

Previous()

Get the previous object of the collection and also decreases the current index of the collection.

RemoveAll()

Removes all objects from the collection.

RemoveAt(int)

Removes an object from a specified index of the collection.

RemoveItem(T)

Removes a specified object from the list.

RemoveLast()

Removes the last object of the collection.

RemoveRange(int, int)

Removes an ellement range from this collection

Resize(int, bool)

change the size of array.

Resize(int, bool, T)

change the size of array.

Reverse()

Changes the order of the collection.

Serialize(Serializer)

This Function is called when saving the vdArray object to vdml format.

SetCurrentIndex(int)

Set the current idex of the collection.

SetPosition(object)

Change the current position of the collection to the index of a given object.

Sort()

Sorts the elements in an entire collection using the IComparable<T> generic interface implementation of each element of the System.Array.

Sort(IComparer<T>)

Sorts the elements in a range of elements in an entire collection using the specified IComparer<T> generic interface.

SortByKeys(Array)

Sorts a range of elements of the collection based on the keys using the specified System.Collections.IComparer implementation of each key.

Start()

Get the first object in the collection and changes the current index to 0.

Swap(T, T)

Swaps the position of two specified object in the list.

ToString()

Gets a System.String that represents the element count of vdArray object.

last()

Get the last object of the collection.