Queue
Queue of generics
# insert elements
queue := Collection.Queue->New()<String>;
queue->AddFront("San Francisco");
queue->AddBack("Oakland");
queue->AddBack("East Bay");
queue->AddBack("Mountain View");
# remove element
queue->RemoveBack();
# get size
queue->Size()->PrintLine();
# get value by key
queue->Back()->PrintLine();
queue->Front()->PrintLine();Operations
AddBack
Adds a value to the back of the queue
method : public : AddBack(value:H) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| value | H | value to add |
AddFront
Adds a value to the front of the queue
method : public : AddFront(value:H) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| value | H | value to add |
Back
Get the value from the back of the queue
method : public : Back() ~ HReturn
| Type | Description |
|---|---|
| H | head value, Nil if queue is empty |
Front
Get the value from the front of the queue
method : public : Front() ~ HReturn
| Type | Description |
|---|---|
| H | head value, Nil if queue is empty |
IsEmpty
Checks to see if the queue is empty
method : public : IsEmpty() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if empty, false otherwise |
RemoveBack
Removes a value from the back of the queue
method : public : RemoveBack() ~ HReturn
| Type | Description |
|---|---|
| H | value removed |