Added Priority Queue Module
This commit is contained in:
+4
@@ -6,7 +6,9 @@ import java.util.Iterator;
|
||||
#endif
|
||||
import speiger.src.collections.PACKAGE.collections.COLLECTION;
|
||||
import speiger.src.collections.PACKAGE.collections.ITERATOR;
|
||||
#if QUEUES_FEATURE
|
||||
import speiger.src.collections.PACKAGE.utils.PRIORITY_QUEUES;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A Type Speciifc PriorityDeque or Dequeue interface to allow implementations like FIFO queues.
|
||||
@@ -81,6 +83,7 @@ public interface PRIORITY_DEQUEUE KEY_GENERIC_TYPE extends PRIORITY_QUEUE KEY_GE
|
||||
*/
|
||||
public default KEY_TYPE last() { return peek(size()-1); }
|
||||
|
||||
#if QUEUES_FEATURE
|
||||
/**
|
||||
* Creates a Wrapped PriorityDequeue that is Synchronized
|
||||
* @return a new PriorityDequeue that is synchronized
|
||||
@@ -96,6 +99,7 @@ public interface PRIORITY_DEQUEUE KEY_GENERIC_TYPE extends PRIORITY_QUEUE KEY_GE
|
||||
*/
|
||||
public default PRIORITY_DEQUEUE KEY_GENERIC_TYPE synchronizeQueue(Object mutex) { return PRIORITY_QUEUES.synchronize(this, mutex); }
|
||||
|
||||
#endif
|
||||
@Override
|
||||
public PRIORITY_DEQUEUE KEY_GENERIC_TYPE copy();
|
||||
}
|
||||
+6
-2
@@ -12,7 +12,9 @@ import speiger.src.collections.PACKAGE.functions.COMPARATOR;
|
||||
import speiger.src.collections.PACKAGE.collections.COLLECTION;
|
||||
import speiger.src.collections.PACKAGE.collections.ITERABLE;
|
||||
import speiger.src.collections.PACKAGE.collections.ITERATOR;
|
||||
#if QUEUES_FEATURE
|
||||
import speiger.src.collections.PACKAGE.utils.PRIORITY_QUEUES;
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
@@ -147,8 +149,9 @@ public interface PRIORITY_QUEUE KEY_GENERIC_TYPE extends ITERABLE KEY_GENERIC_TY
|
||||
* @return draining iterator of the PriorityQueue
|
||||
*/
|
||||
public ITERATOR KEY_GENERIC_TYPE iterator();
|
||||
|
||||
#endif
|
||||
|
||||
#if QUEUES_FEATURE
|
||||
/**
|
||||
* Creates a Wrapped PriorityQueue that is Synchronized
|
||||
* @return a new PriorityQueue that is synchronized
|
||||
@@ -163,7 +166,8 @@ public interface PRIORITY_QUEUE KEY_GENERIC_TYPE extends ITERABLE KEY_GENERIC_TY
|
||||
* @see PRIORITY_QUEUES#synchronize
|
||||
*/
|
||||
public default PRIORITY_QUEUE KEY_GENERIC_TYPE synchronizeQueue(Object mutex) { return PRIORITY_QUEUES.synchronize(this, mutex); }
|
||||
|
||||
|
||||
#endif
|
||||
/**
|
||||
* A method to drop the contents of the Queue without clearing the queue
|
||||
* @Type(E)
|
||||
|
||||
Reference in New Issue
Block a user