public class BooleanArrayFIFOQueue extends java.lang.Object implements BooleanPriorityDequeue, ITrimmable
| Modifier and Type | Field and Description |
|---|---|
static int |
MIN_CAPACITY
The Minimum Capacity that is allowed
|
| Constructor and Description |
|---|
BooleanArrayFIFOQueue()
Default Construtor
|
BooleanArrayFIFOQueue(boolean[] values)
Constructor using a initial array
|
BooleanArrayFIFOQueue(boolean[] values,
int size)
Constructor using a initial array
|
BooleanArrayFIFOQueue(boolean[] values,
int offset,
int size)
Constructor using a initial array
|
BooleanArrayFIFOQueue(int capacity)
Constructor with a Min Capacity
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clears all elements within the PriorityQueue,
this does not resize the backing arrays
|
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
BooleanComparator |
comparator() |
boolean |
dequeueBoolean()
Method to extract a element from the PriorityQueue
|
boolean |
dequeueLastBoolean()
A Method to remove a element from the last place instead of the first
|
void |
enqueueBoolean(boolean e)
Method to insert a element into the PriorityQueue
|
void |
enqueueFirstBoolean(boolean e)
Method to insert a element into the first Index instead of the last.
|
BooleanIterator |
iterator()
Returns an iterator over elements of type
T. |
void |
onChanged()
Allows to notify the Queue to be revalidate its data
|
boolean |
peekBoolean(int index)
Peeking function to see whats inside the queue.
|
boolean |
removeBoolean(boolean e)
Removes the first found element in the queue
|
boolean |
removeLastBoolean(boolean e)
Removes the last found element in the queue
|
int |
size() |
java.lang.Boolean[] |
toArray(java.lang.Boolean[] input)
A method to drop the contents of the Queue without clearing the queue
|
boolean[] |
toBooleanArray(boolean[] input)
A method to drop the contents of the Queue without clearing the queue
|
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdequeueLast, enqueueFirst, last, lastBooleandequeue, enqueue, first, firstBoolean, peek, remove, removeLast, toArray, toBooleanArrayisEmptyforEach, forEach, spliteratorclearAndTrim, trimpublic static final int MIN_CAPACITY
public BooleanArrayFIFOQueue(boolean[] values)
values - the Array that should be usedpublic BooleanArrayFIFOQueue(boolean[] values,
int size)
values - the Array that should be usedsize - the amount of elements that are in the initial arrayjava.lang.IllegalStateException - if values is smaller then sizepublic BooleanArrayFIFOQueue(boolean[] values,
int offset,
int size)
values - the Array that should be usedoffset - where to begin in the initial arraysize - the amount of elements that are in the initial arrayjava.lang.IllegalStateException - if values is smaller then sizepublic BooleanArrayFIFOQueue(int capacity)
capacity - the initial capacity of the backing arrayjava.lang.IllegalStateException - if the initial size is smaller 0public BooleanArrayFIFOQueue()
public BooleanIterator iterator()
BooleanIterableT.iterator in interface java.lang.Iterable<java.lang.Boolean>iterator in interface BooleanIterablepublic int size()
size in interface ObjectPriorityQueue<java.lang.Boolean>public void clear()
ObjectPriorityQueueclear in interface ObjectPriorityQueue<java.lang.Boolean>public void enqueueBoolean(boolean e)
BooleanPriorityQueueenqueueBoolean in interface BooleanPriorityQueuee - the element that should be insertedpublic void enqueueFirstBoolean(boolean e)
BooleanPriorityDequeueenqueueFirstBoolean in interface BooleanPriorityDequeuee - the element that should be inserted into the first placepublic boolean dequeueBoolean()
BooleanPriorityQueuedequeueBoolean in interface BooleanPriorityQueuepublic boolean dequeueLastBoolean()
BooleanPriorityDequeuedequeueLastBoolean in interface BooleanPriorityDequeuepublic boolean peekBoolean(int index)
BooleanPriorityQueuepeekBoolean in interface BooleanPriorityQueueindex - of the element that is requested to be viewed.public boolean removeBoolean(boolean e)
BooleanPriorityQueueremoveBoolean in interface BooleanPriorityQueuee - the element that should be removedpublic boolean removeLastBoolean(boolean e)
BooleanPriorityQueueremoveLastBoolean in interface BooleanPriorityQueuee - the element that should be removedpublic void onChanged()
BooleanPriorityQueueonChanged in interface BooleanPriorityQueueonChanged in interface ObjectPriorityQueue<java.lang.Boolean>public BooleanComparator comparator()
comparator in interface BooleanPriorityQueuecomparator in interface ObjectPriorityQueue<java.lang.Boolean>public boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
clearAndTrim in interface ITrimmablesize - the amount of elements that should be allowedpublic boolean[] toBooleanArray(boolean[] input)
BooleanPriorityQueuetoBooleanArray in interface BooleanPriorityQueueinput - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created arraypublic java.lang.Boolean[] toArray(java.lang.Boolean[] input)
ObjectPriorityQueuetoArray in interface BooleanPriorityQueuetoArray in interface ObjectPriorityQueue<java.lang.Boolean>input - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created array