#include <Graph.h>
Inheritance diagram for VertexArray:
Definition at line 428 of file Graph.h.
Public Member Functions | |
Vertex * | Get (long nr) |
Returns the vertex at a given position. | |
long | GetCount () |
Returns the number of vertices in the array. | |
bool | IsEmpty () |
Returns, if the array is empty. | |
Private Member Functions | |
void | Append (Vertex *Element) |
Appends an element to the array. | |
void | AppendAll (const ArrayList< Vertex > *Elements) |
Appends all elements of another array list to this one. | |
virtual int | Compare (const Vertex *Element1, const Vertex *Element2) const |
Compares two elements and returns -1, if the first is less than the second, 0, if both elements are equal and 1, if the first is more than the second. | |
bool | Contains (const Vertex *Element, int(*compare)(const Vertex *Element1, const Vertex *Element2)) const |
Returns whether a given element is contained in this array. | |
bool | Contains (const Vertex *Element) const |
Returns whether a given element is contained in this array. | |
bool | Delete (Vertex *Element) |
Deletes a given element from the array. | |
bool | Delete (long from, long count) |
Deletes multiple elements at a given range. | |
bool | Delete (long nr) |
Deletes an element at a given position. | |
void | DeleteAll () |
Deletes all elements from the array. | |
bool | DeleteFirst () |
Deletes the first element from the array. | |
bool | DeleteLast () |
Deletes the last element from the array. | |
int | Find (const Vertex *Element, int(*compare)(const Vertex *Element1, const Vertex *Element2)) const |
Returns the 0-indexed position of a given element within the array list. | |
int | Find (const Vertex *Element) const |
Returns the 0-indexed position of a given element within the array list. | |
Vertex * | Get (long nr) const |
Returns the element at a given position. | |
long | GetCount () const |
Returns the number of used array cells. | |
int | GetDesiredFillRatio () const |
Returns the fill ratio after an array resize. | |
int | GetFillRatio () const |
Returns the current fill ratio. | |
Vertex * | GetFirst () const |
Returns the first element of the array. | |
Vertex * | GetLast () const |
Returns the last element of the array. | |
int | GetMinimumFillRatio () const |
Returns the minimum fill ratio for the array. | |
void | Insert (Vertex *Element, long nr) |
Inserts an element before a given position. | |
void | InsertAll (const ArrayList< Vertex > *Elements, long nr) |
Inserts all elements of another array list before a given position. | |
bool | IsEmpty () const |
Returns, whether there are no elements in the array. | |
void | Prepend (Vertex *Element) |
Prepends an element to the array. | |
void | PrependAll (const ArrayList< Vertex > *Elements) |
Prepends all elements of another array list to this one. | |
Vertex * | Replace (Vertex *NewElement, long nr) |
Replaces an element by another one. | |
void | Shuffle () |
Shuffles all entries randomly. | |
void | Sort (int(*compare)(const Vertex *Element1, const Vertex *Element2)) |
Sorts the elements in the array according to a given comparison function. | |
void | Sort () |
Sorts the elements in the array according to the Compare method. | |
bool | Unlink (long from, long count) |
Removes multiple elements from the array. | |
Vertex * | Unlink (Vertex *Element) |
Removes a given element from the array. | |
Vertex * | Unlink (long nr) |
Removes an element at a given position. | |
void | UnlinkAll () |
Removes all elements from the array without freeing them or returning them. | |
Vertex * | UnlinkFirst () |
Removes the first element from the array. | |
Vertex * | UnlinkLast () |
Removes the last element from the array. | |
VertexArray () | |
Creates a new array of vertices. | |
~VertexArray () | |
Destroys the array of vertices. | |
Private Attributes | |
friend | ArrayList<Edge> |
friend | ArrayList<Vertex> |
friend | Edge |
friend | EdgeArray |
friend | Graph |
friend | Vertex |
friend | VertexArray |
|
Creates a new array of vertices.
|
|
Destroys the array of vertices.
|
|
Appends an element to the array.
|
|
Appends all elements of another array list to this one.
|
|
Compares two elements and returns -1, if the first is less than the second, 0, if both elements are equal and 1, if the first is more than the second. This method is used for comparison in the sorting. Override this method to provide your own comparison.
|
|
Returns whether a given element is contained in this array. This method uses a given compare method to compare the elements.
|
|
Returns whether a given element is contained in this array. This method uses the Compare method to compare the elements.
|
|
Deletes a given element from the array. The element is searched, removed from the array and freed. If the element is not contained, nothing happens. If the element is contained multiple times, only one instance is deleted.
|
|
Deletes multiple elements at a given range. The elements are removed from the array and freed.
|
|
Deletes an element at a given position. The element is removed from the array and freed.
|
|
Deletes all elements from the array. All elements are removed from the array and freed. |
|
Deletes the first element from the array. The element is removed from the array and freed. If the array is empty, nothing happens.
|
|
Deletes the last element from the array. The element is removed from the array and freed. If the array is empty, nothing happens.
|
|
Returns the 0-indexed position of a given element within the array list. This method uses a given compare method to compare the elements.
|
|
Returns the 0-indexed position of a given element within the array list. This method uses the Compare method to compare the elements.
|
|
Returns the element at a given position.
|
|
Returns the vertex at a given position.
|
|
Returns the number of used array cells. This is the number of added objects.
|
|
Returns the number of vertices in the array.
|
|
Returns the fill ratio after an array resize.
|
|
Returns the current fill ratio.
|
|
Returns the first element of the array. If the array is empty, the method returns NULL.
|
|
Returns the last element of the array. If the array is empty, the method returns NULL.
|
|
Returns the minimum fill ratio for the array.
|
|
Inserts an element before a given position. All elements at and after the position are moved by one.
|
|
Inserts all elements of another array list before a given position. All elements at and after the position are moved.
|
|
Returns, whether there are no elements in the array.
|
|
Returns, if the array is empty.
|
|
Prepends an element to the array.
|
|
Prepends all elements of another array list to this one.
|
|
Replaces an element by another one. The replaced element is not freed, but returned.
|
|
Shuffles all entries randomly.
|
|
Sorts the elements in the array according to a given comparison function. The whole array has a sorted order afterwards, but is not harmed at all in any other way. All elements remain the same.
|
|
Sorts the elements in the array according to the Compare method. The whole array has a sorted order afterwards, but is not harmed at all in any other way. All elements remain the same. |
|
Removes multiple elements from the array. The elements are not freed.
|
|
Removes a given element from the array. The element is not freed, but returned. If the element is not contained, nothing happens and the method returns NULL. If the element is contained multiple times, only one instance is unlinked.
|
|
Removes an element at a given position. The element is not freed, but returned.
|
|
Removes all elements from the array without freeing them or returning them.
|
|
Removes the first element from the array. The element is not freed, but returned. If the array is empty, nothing happens and the method returns NULL.
|
|
Removes the last element from the array. The element is not freed, but returned. If the array is empty, nothing happens and the method returns NULL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|