java.lang.Object
io.qt.QtObject
io.qt.core.QList<T>
- All Implemented Interfaces:
QtObjectInterface,Cloneable,Iterable<T>,Collection<T>,List<T>
- Direct Known Subclasses:
QBarDataArray,QBluetoothServiceInfo.Alternative,QBluetoothServiceInfo.Sequence,QItemSelection,QNdefMessage,QQueue,QStringList,QSurfaceDataArray,QTestEventList
Java wrapper for Qt class QList
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreating a container with given element type.QList(QMetaType.Type metaType) Creating a container with given element type.protectedQList(io.qt.QtObject.QPrivateConstructor p) Constructor for internal use only.Creating a container with given element type.QList(Collection<T> other) Creating a container with given content. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanfinal booleanaddAll(int index, Collection<? extends T> c) Inserts all of the elements in the specified collection into this list at the specified position.final booleanaddAll(Collection<? extends T> c) Appends all of the elements in the specified collection to the end of this list.final voidappend(Collection<T> t) final voidfinal voidSeeQList::operator=(QList<T>) final Tat(int i) protected final QSequentialIterator<T>begin()final voidclear()clone()Creates and returns a copy of this object.protected final QSequentialConstIterator<T>Provides a constant C++ iterator to the containers begin.protected final QSequentialConstIterator<T>constEnd()Provides a constant C++ iterator to the containers end.final booleanfinal booleancontainsAll(Collection<?> c) Returnstrueif this container contains all of the elements in the specified collection.final intcount()final intCreating a container of type QVariant.final voiddetach()Detached the container if it is shared.protected final QSequentialIterator<T>end()final booleanbooleanfinal Tfirst()get(int index) inthashCode()Returns the objects's hash code computed byqHash(QList<T>).intfinal intfinal voidfinal booleanReturns true if container is not shared.final booleanisEmpty()Returnstrueif this container contains no elements.final booleanisSharedWith(QList<?> other) Returns true of both containers share the same data.iterator()Returns an iterator over elements of typeT.final Tlast()final intfinal intlastIndexOf(T t, int from) final intlength()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.mid(int pos) mid(int pos, int length) final voidmove(int from, int to) static QStringListReturns a QStringList containing given elements.static <T> QList<T>of(T element0, T ... elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Boolean>ofBoolean(boolean ... elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Byte>ofBuffer(ByteBuffer elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Character>ofBuffer(CharBuffer elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Double>ofBuffer(DoubleBuffer elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Float>ofBuffer(FloatBuffer elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Integer>Returns a QList containing given elements.static QList<@QtPrimitiveType Long>ofBuffer(LongBuffer elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Short>ofBuffer(ShortBuffer elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Byte>ofByte(byte ... elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Character>ofChar(char ... elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Double>ofDouble(double ... elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Float>ofFloat(float ... elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Integer>ofInt(int ... elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Long>ofLong(long ... elements) Returns a QList containing given elements.static QList<@QtPrimitiveType Short>ofShort(short ... elements) Returns a QList containing given elements.static <T> QList<T>Returns a QList containing given elements.static <T> QList<T>Returns a QList containing given elements.final voidvoidreadFrom(QDataStream stream) Seeoperator>>(QDataStream&,QList<T>&) final Tremove(int index) Removes the element at the specified position in this list.booleanfinal booleanremoveAll(Collection<?> c) Removes all of this container elements that are also contained in the specified collection.final intfinal voidremoveAt(int i) final Tfinal booleanfinal Tfinal booleanfinal voidfinal voidreserve(int size) final booleanretainAll(Collection<?> c) Retains only the elements in this list that are contained in the specified collection (optional operation).final intsize()Returns the number of elements in this container.final booleanstartsWith(T t) subList(int fromIndex, int toIndex) Returns a view of the portion of this list between the specifiedfromIndex, inclusive, andtoIndex, exclusive.final voidSeeQList::swap(QList<T>&) final voidswapItemsAt(int i, int j) final TtakeAt(int i) final Tfinal TtakeLast()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.toSet()toString()Returns a string representation of this sequential container.final Tvalue(int i) final TvoidwriteTo(QDataStream stream) Seeoperator<<(QDataStream&,QList<T>) Methods inherited from class io.qt.QtObject
dispose, isDisposedMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
addAll, addAll, containsAll, iterator, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
-
Constructor Details
-
QList
protected QList(io.qt.QtObject.QPrivateConstructor p) Constructor for internal use only.- Parameters:
p- expected to benull.
-
QList
Creating a container with given element type.See QList::QList()
- Parameters:
metaType- the type T
-
QList
Creating a container with given element type.See QList::QList()
- Parameters:
elementType- the type T
-
QList
Creating a container with given element type.See QList::QList()
- Parameters:
metaType- the type T
-
QList
Creating a container with given content.- Parameters:
other- container
-
-
Method Details
-
createVariantList
Creating a container of type QVariant. -
clone
Creates and returns a copy of this object. -
append
-
append
-
at
-
clear
-
contains
-
count
-
count
-
begin
-
end
-
constBegin
Provides a constant C++ iterator to the containers begin.- Returns:
- begin
-
constEnd
Provides a constant C++ iterator to the containers end.- Returns:
- end
-
endsWith
-
first
-
indexOf
-
insert
-
isEmpty
Returnstrueif this container contains no elements. -
last
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T>
-
lastIndexOf
-
length
-
mid
-
mid
-
move
-
prepend
-
removeAll
-
removeAt
-
removeFirst
-
removeLast
-
removeOne
-
removeIf
- Specified by:
removeIfin interfaceCollection<T>
-
replace
-
reserve
-
size
Returns the number of elements in this container. If this container contains more thanInteger.MAX_VALUEelements, returnsInteger.MAX_VALUE. -
startsWith
-
takeAt
-
takeFirst
-
takeLast
-
value
-
value
-
equals
-
hashCode
Returns the objects's hash code computed byqHash(QList<T>). -
toString
Returns a string representation of this sequential container.- Returns:
- String
-
add
-
add
-
set
-
remove
-
indexOf
-
get
-
swapItemsAt
-
toSet
-
writeTo
See
operator<<(QDataStream&,QList<T>) -
readFrom
See
operator>>(QDataStream&,QList<T>&) -
of
Returns a QList containing given elements.- Type Parameters:
T- theQList's element type- Parameters:
element0- the first elementelements- subsequent elements- Returns:
- a
QListcontaining the specified element - Throws:
NullPointerException- if elements arenull
-
of
Returns a QStringList containing given elements.- Parameters:
element0- the first elementelements- subsequent elements- Returns:
- a
QStringListcontaining the specified element
-
ofByte
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofShort
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofInt
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofLong
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofChar
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofFloat
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofDouble
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofBoolean
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofBuffer
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofBuffer
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofBuffer
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofBuffer
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofBuffer
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofBuffer
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofBuffer
Returns a QList containing given elements.- Parameters:
elements-- Returns:
- a
QListcontaining the specified element
-
ofTyped
Returns a QList containing given elements.- Type Parameters:
T- theQList's element type- Parameters:
type- theQList's element typeelements- all list elements to be added- Returns:
- a
QListcontaining the specified element
-
ofTyped
Returns a QList containing given elements.- Type Parameters:
T- theQList's element type- Parameters:
metaType- theQList's element typeelements- all list elements to be added- Returns:
- a
QListcontaining the specified element
-
isDetached
Returns true if container is not shared. -
detach
Detached the container if it is shared. -
assign
See
QList::operator=(QList<T>) -
swap
See
QList::swap(QList<T>&) -
addAll
Appends all of the elements in the specified collection to the end of this list.- Specified by:
addAllin interfaceCollection<T>- Specified by:
addAllin 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:
listIteratorin 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:
listIteratorin interfaceList<T>
-
subList
Returns a view of the portion of this list between the specifiedfromIndex, inclusive, andtoIndex, exclusive. (IffromIndexandtoIndexare 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:
retainAllin interfaceCollection<T>- Specified by:
retainAllin interfaceList<T>
-
toArray
Returns an array containing all of the elements in this container.- Specified by:
toArrayin interfaceCollection<T>
-
toArray
Returns an array containing all of the elements in this container.- Specified by:
toArrayin interfaceCollection<T>
-
containsAll
Returnstrueif this container contains all of the elements in the specified collection.- Specified by:
containsAllin interfaceCollection<T>
-
removeAll
Removes all of this container elements that are also contained in the specified collection.- Specified by:
removeAllin interfaceCollection<T>
-
iterator
Returns an iterator over elements of typeT.- Specified by:
iteratorin interfaceCollection<T>- Specified by:
iteratorin interfaceIterable<T>- Returns:
- an Iterator
-