2021-01-20 04:29:08 +01:00
|
|
|
package speiger.src.collections.PACKAGE.queues;
|
|
|
|
|
2021-04-26 02:08:08 +02:00
|
|
|
/**
|
|
|
|
* A Type Speciifc PriorityDeque or Dequeue interface to allow implementations like FIFO queues.
|
|
|
|
* @Type(T)
|
|
|
|
*/
|
2021-01-20 04:29:08 +01:00
|
|
|
public interface PRIORITY_DEQUEUE KEY_GENERIC_TYPE extends PRIORITY_QUEUE KEY_GENERIC_TYPE
|
|
|
|
{
|
2021-04-26 02:08:08 +02:00
|
|
|
/**
|
|
|
|
* Method to insert a element into the first Index instead of the last.
|
|
|
|
* @param e the element that should be inserted into the first place
|
|
|
|
*/
|
2021-06-23 18:38:23 +02:00
|
|
|
public void enqueueFirst(KEY_TYPE e);
|
2021-04-26 02:08:08 +02:00
|
|
|
/**
|
|
|
|
* A Method to remove a element from the last place instead of the first
|
|
|
|
* @return the last element inserted
|
|
|
|
* @throws java.util.NoSuchElementException if no element is in the deque
|
|
|
|
*/
|
2021-06-23 19:22:19 +02:00
|
|
|
public KEY_TYPE dequeueLast();
|
2021-04-26 02:08:08 +02:00
|
|
|
/**
|
|
|
|
* Peeking function for the last element
|
|
|
|
* @return the Last Element within the dequeue without deleting it
|
|
|
|
*/
|
2021-06-23 19:22:19 +02:00
|
|
|
public default KEY_TYPE last() { return peek(size()-1); }
|
2021-01-20 04:29:08 +01:00
|
|
|
}
|