Class PRIOQueue<E>
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
jmt.jmch.animation.customQueue.PRIOQueue<E>
- All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess, SequencedCollection, CustomCollection
ArrayList that implements the CustomCollection interface, to act as a Priority Queue.
This queue needs a Comparator when instantiated, so all the queues that are not LIFO or FIFO can be implemented with this class.
- Author:
- Lorenzo Torri Date: 25-mar-2024 Time: 13.20
- See Also:
-
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd a new element to the Collection, how to add and where to add it, it will be handled by the classes that implements this interfacefirst()Retrieve the first element of the CollectionbooleanRemove the head of the CollectionbooleanRemove the Object o from the list.Methods inherited from class ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface CustomCollection
iterator, sizeMethods inherited from interface List
containsAll, reversed
-
Constructor Details
-
PRIOQueue
-
-
Method Details
-
addNew
Description copied from interface:CustomCollectionAdd a new element to the Collection, how to add and where to add it, it will be handled by the classes that implements this interface- Specified by:
addNewin interfaceCustomCollection<E>- Parameters:
o- Object to add- Returns:
- true if the adding was successful
-
removeHead
public boolean removeHead()Description copied from interface:CustomCollectionRemove the head of the Collection- Specified by:
removeHeadin interfaceCustomCollection<E>- Returns:
- true if the head is removed correctly
-
first
Description copied from interface:CustomCollectionRetrieve the first element of the Collection- Specified by:
firstin interfaceCustomCollection<E>- Returns:
- the first element of the Collection, null otherwise
-
removeObject
Description copied from interface:CustomCollectionRemove the Object o from the list. Used for specific cases like BoxStation in PS that has to remove the job from the queue- Specified by:
removeObjectin interfaceCustomCollection<E>- Parameters:
e- the object- Returns:
- true if it has removed the object correctly
-