Class LIFOQueue<E>
java.lang.Object
java.util.AbstractCollection
java.util.ArrayDeque
jmt.jmch.animation.customQueue.LIFOQueue<E>
- All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, Deque, Queue, SequencedCollection, CustomCollection
ArrayDeque that implements the CustomCollection interface, to act as a LIFO Queue
- Author:
- Lorenzo Torri Date: 25-mar-2024 Time: 13.32
- See Also:
-
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 ArrayDeque
add, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, forEach, getFirst, getLast, isEmpty, iterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeAll, removeFirst, removeFirstOccurrence, removeIf, removeLast, removeLastOccurrence, retainAll, size, spliterator, toArray, toArrayMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Collection
containsAll, equals, hashCode, parallelStream, stream, toArrayMethods inherited from interface CustomCollection
iterator, size
-
Constructor Details
-
LIFOQueue
public LIFOQueue()
-
-
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
-