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 TypeMethodDescriptionvoid
add
(int element) adds an int at the end of the FIFOvoid
clear()
boolean
isEmpty()
iterator()
int
peek()
inspection of the first element, without removalint
pop()
takes the first element, removes it from the FIFO and returns itprivate void
resize()
increase the size of the queueint
size()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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
-