Package org.jacop.jasat.utils.structures
Class IntQueue
java.lang.Object
org.jacop.jasat.utils.structures.IntQueue
Special class for unboxed int FIFO
- Version:
- 4.10
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int element) adds an int at the end of the FIFOvoidclear()booleanisEmpty()iterator()intpeek()inspection of the first element, without removalintpop()takes the first element, removes it from the FIFO and returns itprivate voidresize()increase the size of the queueintsize()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
array
public int[] array -
start
public int start -
stop
public int stop -
pool
-
-
Constructor Details
-
IntQueue
-
-
Method Details
-
clear
public void clear() -
isEmpty
public boolean isEmpty() -
add
public void add(int element) adds an int at the end of the FIFO- Parameters:
element- the element to add
-
peek
public int peek()inspection of the first element, without removal- Returns:
- the first element of the array
-
pop
public int pop()takes the first element, removes it from the FIFO and returns it- Returns:
- the first element from the FIFO queue
-
size
public int size() -
resize
private void resize()increase the size of the queue -
toString
-
iterator
-