Fork me on GitHub
Library for MQL5 (MetaTrader) with support for Spark
CArrayList< Type > Class Template Reference

Detailed Description

template<typename Type>
class CArrayList< Type >

ArrayList from Java.


The documentation for this class was generated from the following file:

Public Member Functions

 CArrayList (int _reserve=0)
 
int getReserve ()
 
void setReserve (int _reserve)
 
bool add (const Type element)
 Appends the specified element to the end of this list. More...
 
bool add (int index, const Type element)
 Inserts the specified element at the specified position in this list. More...
 
bool addAll (const Type &list[])
 Appends all of the elements in the specified collection to the end of this list. More...
 
bool addAll (const CArrayList< Type > &list)
 Appends all of the elements in the specified collection to the end of this list. More...
 
bool addAll (int index, const Type &list[])
 Inserts all of the elements in the specified collection into this list, starting at the specified position. More...
 
bool addAll (int index, const CArrayList< Type > &list)
 Inserts all of the elements in the specified collection into this list, starting at the specified position. More...
 
void clear ()
 Removes all of the elements from this list. More...
 
bool contains (const Type o)
 Returns true if this list contains the specified element. More...
 
Type get (int index)
 Returns the element at the specified position in this list. More...
 
Type operator[] (int index)
 Returns the element at the specified position in this list. More...
 
Type set (int index, const Type element)
 Replaces the element at the specified position in this list with the specified element. More...
 
int indexOf (const Type o)
 Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More...
 
int lastIndexOf (const Type o)
 Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. More...
 
bool isEmpty ()
 Returns true if this list contains no elements. More...
 
Type remove (int index)
 Removes the element at the specified position in this list. More...
 
bool removeFirst (const Type o)
 Removes the first occurrence of the specified element from this list, if it is present. More...
 
bool removeAll (const Type &list[])
 Removes from this list all of its elements that are contained in the specified collection. More...
 
bool retainAll (const Type &list[])
 Retains only the elements in this list that are contained in the specified collection. More...
 
int size ()
 Returns the number of elements in this list. More...
 
int subList (Type &dst_array[], int dst_start=0, int src_start=0, int count=WHOLE_ARRAY)
 
void toArray (Type &dst_array[])
 Returns an array containing all of the elements in this list in proper sequence (from first to last element). More...
 

Protected Member Functions

bool removeList (const Type &list[], bool saveOnlyList=false)
 

Protected Attributes

Type elements []
 
int reserve
 

Constructor & Destructor Documentation

◆ CArrayList()

template<typename Type >
CArrayList< Type >::CArrayList ( int  _reserve = 0)

Member Function Documentation

◆ add() [1/2]

template<typename Type >
bool CArrayList< Type >::add ( const Type  element)

Appends the specified element to the end of this list.

◆ add() [2/2]

template<typename Type >
bool CArrayList< Type >::add ( int  index,
const Type  element 
)

Inserts the specified element at the specified position in this list.

◆ addAll() [1/4]

template<typename Type >
bool CArrayList< Type >::addAll ( const Type &  list[])

Appends all of the elements in the specified collection to the end of this list.

◆ addAll() [2/4]

template<typename Type >
bool CArrayList< Type >::addAll ( const CArrayList< Type > &  list)

Appends all of the elements in the specified collection to the end of this list.

◆ addAll() [3/4]

template<typename Type >
bool CArrayList< Type >::addAll ( int  index,
const Type &  list[] 
)

Inserts all of the elements in the specified collection into this list, starting at the specified position.

◆ addAll() [4/4]

template<typename Type >
bool CArrayList< Type >::addAll ( int  index,
const CArrayList< Type > &  list 
)

Inserts all of the elements in the specified collection into this list, starting at the specified position.

◆ clear()

template<typename Type >
void CArrayList< Type >::clear ( )

Removes all of the elements from this list.

◆ contains()

template<typename Type >
bool CArrayList< Type >::contains ( const Type  o)

Returns true if this list contains the specified element.

◆ get()

template<typename Type >
Type CArrayList< Type >::get ( int  index)

Returns the element at the specified position in this list.

◆ getReserve()

template<typename Type >
int CArrayList< Type >::getReserve ( )

◆ indexOf()

template<typename Type >
int CArrayList< Type >::indexOf ( const Type  o)

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

◆ isEmpty()

template<typename Type >
bool CArrayList< Type >::isEmpty ( )

Returns true if this list contains no elements.

◆ lastIndexOf()

template<typename Type >
int CArrayList< Type >::lastIndexOf ( const Type  o)

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

◆ operator[]()

template<typename Type >
Type CArrayList< Type >::operator[] ( int  index)

Returns the element at the specified position in this list.

◆ remove()

template<typename Type >
Type CArrayList< Type >::remove ( int  index)

Removes the element at the specified position in this list.

◆ removeAll()

template<typename Type >
bool CArrayList< Type >::removeAll ( const Type &  list[])

Removes from this list all of its elements that are contained in the specified collection.

◆ removeFirst()

template<typename Type >
bool CArrayList< Type >::removeFirst ( const Type  o)

Removes the first occurrence of the specified element from this list, if it is present.

◆ removeList()

template<typename Type >
bool CArrayList< Type >::removeList ( const Type &  list[],
bool  saveOnlyList = false 
)
protected

◆ retainAll()

template<typename Type >
bool CArrayList< Type >::retainAll ( const Type &  list[])

Retains only the elements in this list that are contained in the specified collection.

◆ set()

template<typename Type >
Type CArrayList< Type >::set ( int  index,
const Type  element 
)

Replaces the element at the specified position in this list with the specified element.

◆ setReserve()

template<typename Type >
void CArrayList< Type >::setReserve ( int  _reserve)

◆ size()

template<typename Type >
int CArrayList< Type >::size ( )

Returns the number of elements in this list.

◆ subList()

template<typename Type >
int CArrayList< Type >::subList ( Type &  dst_array[],
int  dst_start = 0,
int  src_start = 0,
int  count = WHOLE_ARRAY 
)

◆ toArray()

template<typename Type >
void CArrayList< Type >::toArray ( Type &  dst_array[])

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

Member Data Documentation

◆ elements

template<typename Type >
Type CArrayList< Type >::elements[]
protected

◆ reserve

template<typename Type >
int CArrayList< Type >::reserve
protected