java.lang.Object
io.qt.QtObject
io.qt.core.QVector<T>
io.qt.core.QStack<T>
- All Implemented Interfaces:
QtObjectInterface
,Cloneable
,Iterable<T>
,Collection<T>
,Deque<T>
,List<T>
,Queue<T>
-
Constructor Summary
ConstructorDescriptionCreating a container with given element type and size.QStack
(QMetaType.Type metaType) Creating a container with given element type and size.Creating a container with given element type.QStack
(Collection<T> other) Creating a container with given content. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
addAll
(int index, Collection<? extends T> c) Inserts all of the elements in the specified collection into this list at the specified position.final boolean
addAll
(Collection<? extends T> c) Appends all of the elements in the specified collection to the end of this list.void
void
asDeque()
Due to changes in Java 21 QStack does no longer implement Deque interface.clone()
Creates and returns a copy of this object.final boolean
containsAll
(Collection<?> c) Returnstrue
if this container contains all of the elements in the specified collection.Creating a container of type QVariant.element()
getFirst()
getLast()
iterator()
Returns an iterator over elements of typeT
.final ListIterator<T>
Returns a list iterator over the elements in this list (in proper sequence).final ListIterator<T>
listIterator
(int index) Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.static <T> QStack<T>
of
(T element0, T ... elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Boolean>
ofBoolean
(boolean ... elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Byte>
ofBuffer
(ByteBuffer elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Character>
ofBuffer
(CharBuffer elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Double>
ofBuffer
(DoubleBuffer elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Float>
ofBuffer
(FloatBuffer elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Integer>
Returns a QStack containing given elements.static QStack<@QtPrimitiveType Long>
ofBuffer
(LongBuffer elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Short>
ofBuffer
(ShortBuffer elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Byte>
ofByte
(byte ... elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Character>
ofChar
(char ... elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Double>
ofDouble
(double ... elements) Returns a QStack containing given elements.boolean
boolean
offerFirst
(T e) boolean
static QStack<@QtPrimitiveType Float>
ofFloat
(float ... elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Integer>
ofInt
(int ... elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Long>
ofLong
(long ... elements) Returns a QStack containing given elements.static QStack<@QtPrimitiveType Short>
ofShort
(short ... elements) Returns a QStack containing given elements.static <T> QStack<T>
Returns a QStack containing given elements.static <T> QStack<T>
Returns a QStack containing given elements.peek()
peekLast()
poll()
pollLast()
pop()
SeeQStack::
pop() void
SeeQStack::
push(T) remove()
final T
remove
(int index) Removes the element at the specified position in this list.final boolean
removeAll
(Collection<?> c) Removes all of this container elements that are also contained in the specified collection.boolean
boolean
final boolean
retainAll
(Collection<?> c) Retains only the elements in this list that are contained in the specified collection (optional operation).subList
(int fromIndex, int toIndex) Returns a view of the portion of this list between the specifiedfromIndex
, inclusive, andtoIndex
, exclusive.final T[]
toArray()
Returns an array containing all of the elements in this container.final <A> A[]
toArray
(A[] a) Returns an array containing all of the elements in this container.final T
top()
Creates and returns a copy of this object.Methods inherited from class io.qt.core.QVector
add, add, append, append, assign, at, begin, capacity, clear, constBegin, constEnd, contains, count, count, createVariantVector, detach, end, endsWith, equals, fill, fill, first, get, hashCode, indexOf, indexOf, insert, insert, isDetached, isEmpty, isSharedWith, last, lastIndexOf, lastIndexOf, length, mid, mid, move, prepend, readFrom, remove, remove, removeAll, removeAt, removeFirst, removeIf, removeLast, removeOne, replace, reserve, resize, set, size, squeeze, startsWith, swap, swapItemsAt, takeAt, takeFirst, takeLast, toSet, toString, value, value, writeTo
Methods inherited from class io.qt.QtObject
dispose, isDisposed
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Deque
add, addAll, contains, iterator, remove, removeFirst, removeLast, size
Methods inherited from interface java.util.List
containsAll, iterator, removeAll, replaceAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
QStack
Creating a container with given element type and size.See
QStack::
QStack() - Parameters:
metaType
- the type T
-
QStack
Creating a container with given element type and size.See
QStack::
QStack() - Parameters:
metaType
- the type T
-
QStack
Creating a container with given element type.See
QStack::
QStack() - Parameters:
elementType
- the type T
-
QStack
Creating a container with given content.- Parameters:
other
- container
-
-
Method Details
-
createVariantStack
Creating a container of type QVariant. -
clone
Creates and returns a copy of this object. -
remove
-
addFirst
-
addLast
-
offerFirst
- Specified by:
offerFirst
in interfaceDeque<T>
- See Also:
-
offerLast
-
pollFirst
-
pollLast
-
getFirst
-
getLast
-
poll
-
element
-
peek
-
offer
-
removeFirstOccurrence
- Specified by:
removeFirstOccurrence
in interfaceDeque<T>
- See Also:
-
removeLastOccurrence
- Specified by:
removeLastOccurrence
in interfaceDeque<T>
- See Also:
-
descendingIterator
- Specified by:
descendingIterator
in interfaceDeque<T>
- See Also:
-
peekFirst
-
peekLast
-
push
See
QStack::
push(T) -
pop
See
QStack::
pop() -
top
Creates and returns a copy of this object. -
asDeque
Due to changes in Java 21 QStack does no longer implement Deque interface. Instead callasDeque()
to get a Deque wrapper for the stack.- Returns:
- Deque wrapper
- Since:
- 5.15.18
-
of
Returns a QStack containing given elements.- Type Parameters:
T
- theQStack
's element type- Parameters:
element0
- the first elementelements
- subsequent elements- Returns:
- a
QStack
containing the specified element - Throws:
NullPointerException
- if elements arenull
-
ofByte
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofShort
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofInt
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofLong
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofChar
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofFloat
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofDouble
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofBoolean
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofBuffer
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofBuffer
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofBuffer
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofBuffer
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofBuffer
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofBuffer
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofBuffer
Returns a QStack containing given elements.- Parameters:
elements
-- Returns:
- a
QStack
containing the specified element
-
ofTyped
Returns a QStack containing given elements.- Type Parameters:
T
- theQStack
's element type- Parameters:
type
- theQStack
's element typeelements
- all list elements to be added- Returns:
- a
QStack
containing the specified element
-
ofTyped
Returns a QStack containing given elements.- Type Parameters:
T
- theQStack
's element type- Parameters:
metaType
- theQStack
's element typeelements
- all list elements to be added- Returns:
- a
QStack
containing the specified element
-
addAll
Appends all of the elements in the specified collection to the end of this list.- Specified by:
addAll
in interfaceCollection<T>
- Specified by:
addAll
in interfaceList<T>
-
addAll
Inserts all of the elements in the specified collection into this list at the specified position. -
remove
Removes the element at the specified position in this list. -
listIterator
Returns a list iterator over the elements in this list (in proper sequence).- Specified by:
listIterator
in interfaceList<T>
-
listIterator
Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.- Specified by:
listIterator
in interfaceList<T>
-
subList
Returns a view of the portion of this list between the specifiedfromIndex
, inclusive, andtoIndex
, exclusive. (IffromIndex
andtoIndex
are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list. -
retainAll
Retains only the elements in this list that are contained in the specified collection (optional operation). In other words, removes from this list all of its elements that are not contained in the specified collection.- Specified by:
retainAll
in interfaceCollection<T>
- Specified by:
retainAll
in interfaceList<T>
-
toArray
Returns an array containing all of the elements in this container.- Specified by:
toArray
in interfaceCollection<T>
-
toArray
Returns an array containing all of the elements in this container.- Specified by:
toArray
in interfaceCollection<T>
-
containsAll
Returnstrue
if this container contains all of the elements in the specified collection.- Specified by:
containsAll
in interfaceCollection<T>
-
removeAll
Removes all of this container elements that are also contained in the specified collection.- Specified by:
removeAll
in interfaceCollection<T>
-
iterator
Returns an iterator over elements of typeT
.- Specified by:
iterator
in interfaceCollection<T>
- Specified by:
iterator
in interfaceIterable<T>
- Returns:
- an Iterator
-