forked from Khaaz/AxonCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* SortedList Object. Sorted Array of element (ascending or descending order) | ||
* @author KhaaZ | ||
* @class SortedList | ||
*/ | ||
export declare class SortedList<T> { | ||
public ascending: boolean; | ||
/** Whether toInsert is bigger than baseElement */ | ||
public comparator: (toInsert: T, baseElement: T) => boolean; | ||
public list: T[]; | ||
/** | ||
* Creates an instance of SortedList | ||
* @memberof SortedList | ||
*/ | ||
constructor(comparator?: (toInsert: T, baseElement: T) => boolean, ascending?: boolean); | ||
|
||
/** | ||
* Size of the list | ||
* @readonly | ||
* @memberof SortedList | ||
*/ | ||
public size: number; | ||
|
||
/** | ||
* Whether the list is empty or not | ||
* @memberof SortedList | ||
*/ | ||
public isEmpty(): boolean; | ||
/** | ||
* Returns the first element of the list without removing it | ||
* @memberof SortedList | ||
*/ | ||
public first(): T; | ||
/** | ||
* Returns the first element of the list without removing it | ||
* @memberof SortedList | ||
*/ | ||
public first(): T; | ||
/** | ||
* Returns the last element of the list without removing it | ||
* @memberof SortedList | ||
*/ | ||
public last(): T; | ||
/** | ||
* Adds an element in the queue, sorting by ascending timeout | ||
* @memberof SortedList | ||
*/ | ||
add(element: T, comparator?: (toInsert: T, baseElement: T) => boolean): void; | ||
/** | ||
* Get the first element in the queue and removes it | ||
* @memberof SortedList | ||
*/ | ||
shift(): T; | ||
/** | ||
* Get the last element in the queue and removes it | ||
* @memberof SortedList | ||
*/ | ||
pop(): T; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters