Module qtjambi
Package io.qt.core

Class QList<T>

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

public class QList<T> extends QtObject implements List<T>, Cloneable

Java wrapper for Qt class QList

  • Constructor Details

    • QList

      protected QList(io.qt.QtObject.QPrivateConstructor p)
      Constructor for internal use only.
      Parameters:
      p - expected to be null.
    • QList

      public QList(QMetaType.Type metaType)
      Creating a container with given element type.

      See QList::QList()

      Parameters:
      metaType - the type T
    • QList

      public QList(Class<T> elementType)
      Creating a container with given element type.

      See QList::QList()

      Parameters:
      elementType - the type T
    • QList

      public QList(QMetaType metaType)
      Creating a container with given element type.

      See QList::QList()

      Parameters:
      metaType - the type T
    • QList

      public QList(Collection<T> other)
      Creating a container with given content.

      See QList::QList(const QList<T> &)

      Parameters:
      other - container
  • Method Details

    • createVariantList

      public static QList<Object> createVariantList()
      Creating a container of type QVariant.
    • clone

      public QList<T> clone()
      Creates and returns a copy of this object.

      See QList::QList(const QList<T> &)

    • append

      @QtUninvokable public final void append(Collection<T> t)
    • append

      @QtUninvokable public final void append(T t)
    • at

      @QtUninvokable public final T at(int i)
    • clear

      @QtUninvokable public final void clear()
      Specified by:
      clear in interface Collection<T>
      Specified by:
      clear in interface List<T>
    • contains

      @QtUninvokable public final boolean contains(Object t)
      Specified by:
      contains in interface Collection<T>
      Specified by:
      contains in interface List<T>
    • count

      @QtUninvokable public final int count()
    • count

      @QtUninvokable public final int count(T t)
    • begin

      @QtUninvokable protected final QSequentialIterator<T> begin()
    • end

      @QtUninvokable protected final QSequentialIterator<T> end()
    • constBegin

      @QtUninvokable protected final QSequentialConstIterator<T> constBegin()
      Provides a constant C++ iterator to the containers begin.
      Returns:
      begin
    • constEnd

      @QtUninvokable protected final QSequentialConstIterator<T> constEnd()
      Provides a constant C++ iterator to the containers end.
      Returns:
      end
    • endsWith

      @QtUninvokable public final boolean endsWith(T t)
    • first

      @QtUninvokable public final T first()
    • indexOf

      @QtUninvokable public final int indexOf(T t, int from)
    • insert

      @QtUninvokable public final void insert(int i, T t)
    • isEmpty

      @QtUninvokable public final boolean isEmpty()
      Returns true if this container contains no elements.
      Specified by:
      isEmpty in interface Collection<T>
      Specified by:
      isEmpty in interface List<T>
      Returns:
      true if this container contains no elements
    • last

      @QtUninvokable public final T last()
    • lastIndexOf

      @QtUninvokable public final int lastIndexOf(Object t)
      Specified by:
      lastIndexOf in interface List<T>
    • lastIndexOf

      @QtUninvokable public final int lastIndexOf(T t, int from)
    • length

      @QtUninvokable public final int length()
    • mid

      @QtUninvokable public final QList<T> mid(int pos)
    • mid

      @QtUninvokable public final QList<T> mid(int pos, int length)
    • move

      @QtUninvokable public final void move(int from, int to)
    • prepend

      @QtUninvokable public final void prepend(T t)
    • removeAll

      @QtUninvokable public final int removeAll(T t)
    • removeAt

      @QtUninvokable public final void removeAt(int i)
    • removeFirst

      @QtUninvokable public final T removeFirst()
    • removeLast

      @QtUninvokable public final T removeLast()
    • removeOne

      @QtUninvokable public final boolean removeOne(T t)
    • removeIf

      @QtUninvokable public final boolean removeIf(Predicate<? super T> predicate)
      Specified by:
      removeIf in interface Collection<T>
    • replace

      @QtUninvokable public final void replace(int i, T t)
    • reserve

      @QtUninvokable public final void reserve(int size)
    • size

      @QtUninvokable public final int size()
      Returns the number of elements in this container. If this container contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
      Specified by:
      size in interface Collection<T>
      Specified by:
      size in interface List<T>
      Returns:
      the number of elements in this container
    • startsWith

      @QtUninvokable public final boolean startsWith(T t)
    • takeAt

      @QtUninvokable public final T takeAt(int i)
    • takeFirst

      @QtUninvokable public final T takeFirst()
    • takeLast

      @QtUninvokable public final T takeLast()
    • value

      @QtUninvokable public final T value(int i)
    • value

      @QtUninvokable public final T value(int i, T defaultValue)
    • equals

      @QtUninvokable public boolean equals(Object other)
      Specified by:
      equals in interface Collection<T>
      Specified by:
      equals in interface List<T>
      Overrides:
      equals in class QtObject
      Parameters:
      other - other object
      Returns:
      true if the native counterpart of the two objects are one and the same.
    • hashCode

      @QtUninvokable public int hashCode()
      Returns the objects's hash code computed by qHash(QList<T>).
      Specified by:
      hashCode in interface Collection<T>
      Specified by:
      hashCode in interface List<T>
      Overrides:
      hashCode in class Object
    • toString

      @QtUninvokable public String toString()
      Returns a string representation of this sequential container.
      Returns:
      String
    • add

      @QtUninvokable public boolean add(T e)
      Specified by:
      add in interface Collection<T>
      Specified by:
      add in interface List<T>
    • add

      @QtUninvokable public void add(int index, T e)
      Specified by:
      add in interface List<T>
    • set

      @QtUninvokable public T set(int index, T e)
      Specified by:
      set in interface List<T>
    • remove

      @QtUninvokable public boolean remove(Object e)
      Specified by:
      remove in interface Collection<T>
      Specified by:
      remove in interface List<T>
    • indexOf

      @QtUninvokable public int indexOf(Object e)
      Specified by:
      indexOf in interface List<T>
    • get

      @QtUninvokable public T get(int index)
      Specified by:
      get in interface List<T>
    • swapItemsAt

      @QtUninvokable public final void swapItemsAt(int i, int j)
    • toSet

      @QtUninvokable public final QSet<T> toSet()
    • writeTo

      @QtUninvokable public void writeTo(QDataStream stream)

      See operator<<(QDataStream&,QList<T>)

    • readFrom

      @QtUninvokable public void readFrom(QDataStream stream)

      See operator>>(QDataStream&,QList<T>&)

    • of

      @SafeVarargs public static <T> QList<T> of(T element0, T ... elements)
      Returns a QList containing given elements.
      Type Parameters:
      T - the QList's element type
      Parameters:
      element0 - the first element
      elements - subsequent elements
      Returns:
      a QList containing the specified element
      Throws:
      NullPointerException - if elements are null
    • of

      @SafeVarargs public static QStringList of(String element0, String ... elements)
      Returns a QStringList containing given elements.
      Parameters:
      element0 - the first element
      elements - subsequent elements
      Returns:
      a QStringList containing the specified element
    • ofByte

      public static QList<@QtPrimitiveType Byte> ofByte(byte ... elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofShort

      public static QList<@QtPrimitiveType Short> ofShort(short ... elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofInt

      public static QList<@QtPrimitiveType Integer> ofInt(int ... elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofLong

      public static QList<@QtPrimitiveType Long> ofLong(long ... elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofChar

      public static QList<@QtPrimitiveType Character> ofChar(char ... elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofFloat

      public static QList<@QtPrimitiveType Float> ofFloat(float ... elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofDouble

      public static QList<@QtPrimitiveType Double> ofDouble(double ... elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofBoolean

      public static QList<@QtPrimitiveType Boolean> ofBoolean(boolean ... elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofBuffer

      public static QList<@QtPrimitiveType Byte> ofBuffer(ByteBuffer elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofBuffer

      public static QList<@QtPrimitiveType Short> ofBuffer(ShortBuffer elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofBuffer

      public static QList<@QtPrimitiveType Integer> ofBuffer(IntBuffer elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofBuffer

      public static QList<@QtPrimitiveType Long> ofBuffer(LongBuffer elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofBuffer

      public static QList<@QtPrimitiveType Character> ofBuffer(CharBuffer elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofBuffer

      public static QList<@QtPrimitiveType Float> ofBuffer(FloatBuffer elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofBuffer

      public static QList<@QtPrimitiveType Double> ofBuffer(DoubleBuffer elements)
      Returns a QList containing given elements.
      Parameters:
      elements -
      Returns:
      a QList containing the specified element
    • ofTyped

      @SafeVarargs public static <T> QList<T> ofTyped(Class<? super T> type, T ... elements)
      Returns a QList containing given elements.
      Type Parameters:
      T - the QList's element type
      Parameters:
      type - the QList's element type
      elements - all list elements to be added
      Returns:
      a QList containing the specified element
    • ofTyped

      @SafeVarargs public static <T> QList<T> ofTyped(QMetaType metaType, T ... elements)
      Returns a QList containing given elements.
      Type Parameters:
      T - the QList's element type
      Parameters:
      metaType - the QList's element type
      elements - all list elements to be added
      Returns:
      a QList containing the specified element
    • isSharedWith

      @QtUninvokable public final boolean isSharedWith(QList<?> other)
      Returns true of both containers share the same data.
    • isDetached

      @QtUninvokable public final boolean isDetached()
      Returns true if container is not shared.
    • detach

      @QtUninvokable public final void detach()
      Detached the container if it is shared.
    • assign

      @QtUninvokable public final void assign(QList<T> other)

      See QList::operator=(QList<T>)

    • swap

      @QtUninvokable public final void swap(QList<T> other)

      See QList::swap(QList<T>&)

    • addAll

      @QtUninvokable public final boolean addAll(Collection<? extends T> c)
      Appends all of the elements in the specified collection to the end of this list.
      Specified by:
      addAll in interface Collection<T>
      Specified by:
      addAll in interface List<T>
    • addAll

      @QtUninvokable public final boolean addAll(int index, Collection<? extends T> c)
      Inserts all of the elements in the specified collection into this list at the specified position.
      Specified by:
      addAll in interface List<T>
    • remove

      @QtUninvokable public final T remove(int index)
      Removes the element at the specified position in this list.
      Specified by:
      remove in interface List<T>
    • listIterator

      @QtUninvokable public final ListIterator<T> listIterator()
      Returns a list iterator over the elements in this list (in proper sequence).
      Specified by:
      listIterator in interface List<T>
    • listIterator

      @QtUninvokable public 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.
      Specified by:
      listIterator in interface List<T>
    • subList

      @QtUninvokable public final List<T> subList(int fromIndex, int toIndex)
      Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex 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.
      Specified by:
      subList in interface List<T>
    • retainAll

      @QtUninvokable public final boolean retainAll(Collection<?> c)
      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 interface Collection<T>
      Specified by:
      retainAll in interface List<T>
    • toArray

      @QtUninvokable public final T[] toArray()
      Returns an array containing all of the elements in this container.
      Specified by:
      toArray in interface Collection<T>
    • toArray

      @QtUninvokable public final <A> A[] toArray(A[] a)
      Returns an array containing all of the elements in this container.
      Specified by:
      toArray in interface Collection<T>
    • containsAll

      @QtUninvokable public final boolean containsAll(Collection<?> c)
      Returns true if this container contains all of the elements in the specified collection.
      Specified by:
      containsAll in interface Collection<T>
    • removeAll

      @QtUninvokable public final boolean removeAll(Collection<?> c)
      Removes all of this container elements that are also contained in the specified collection.
      Specified by:
      removeAll in interface Collection<T>
    • iterator

      @QtUninvokable public final Iterator<T> iterator()
      Returns an iterator over elements of type T.
      Specified by:
      iterator in interface Collection<T>
      Specified by:
      iterator in interface Iterable<T>
      Returns:
      an Iterator