Package com.crawljax.core
Class CrawlQueue
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.Vector<E>
-
- java.util.Stack<Runnable>
-
- com.crawljax.core.CrawlQueue
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Runnable>,Collection<Runnable>,BlockingQueue<Runnable>,List<Runnable>,Queue<Runnable>,RandomAccess
public class CrawlQueue extends Stack<Runnable> implements BlockingQueue<Runnable>
This class implements a BlockingQueue with Runnable as its Generic type and extends Stack with also Runnable as generic type. This class is used in the ThreadPoolExecutor and its used to store separate threads in a Queue like fashion (FILO).- Author:
- Stefan Lenselink <S.R.Lenselink@student.tudelft.nl>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDAuto generated serialVersionUID.-
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description CrawlQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdrainTo(Collection<? super Runnable> c)intdrainTo(Collection<? super Runnable> c, int maxRunnableElements)Runnableelement()booleanoffer(Runnable e)booleanoffer(Runnable e, long timeout, TimeUnit unit)Runnablepoll()Runnablepoll(long timeout, TimeUnit unit)voidput(Runnable e)intremainingCapacity()Runnableremove()Runnabletake()-
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, remove
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Auto generated serialVersionUID.- See Also:
- Constant Field Values
-
-
Method Detail
-
drainTo
public int drainTo(Collection<? super Runnable> c)
- Specified by:
drainToin interfaceBlockingQueue<Runnable>
-
drainTo
public int drainTo(Collection<? super Runnable> c, int maxRunnableElements)
- Specified by:
drainToin interfaceBlockingQueue<Runnable>
-
offer
public boolean offer(Runnable e)
-
offer
public boolean offer(Runnable e, long timeout, TimeUnit unit)
- Specified by:
offerin interfaceBlockingQueue<Runnable>
-
poll
public Runnable poll(long timeout, TimeUnit unit)
- Specified by:
pollin interfaceBlockingQueue<Runnable>
-
put
public void put(Runnable e)
- Specified by:
putin interfaceBlockingQueue<Runnable>
-
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacityin interfaceBlockingQueue<Runnable>
-
take
public Runnable take()
- Specified by:
takein interfaceBlockingQueue<Runnable>
-
-