Module qtjambi
Package io.qt.core

Class QVector<T>

java.lang.Object
io.qt.QtObject
io.qt.core.QVector<T>
All Implemented Interfaces:
QtObjectInterface, Cloneable, Iterable<T>, Collection<T>, List<T>
Direct Known Subclasses:
QBarDataRow, QPolygon, QPolygonF, QScatterDataArray, QStack, QSurfaceDataRow, QXmlStreamAttributes

public class QVector<T> extends QtObject implements Cloneable

Java wrapper for Qt class QVector

  • Constructor Details

    • QVector

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

      public QVector(QMetaType.Type metaType)
    • QVector

      public QVector(Class<T> elementType)
    • QVector

      public QVector(QMetaType metaType)
    • QVector

      public QVector(Collection<T> other)
  • Method Details

    • createVariantVector

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

      public QVector<T> clone()
      Creates and returns a copy of this object.
    • 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)
    • 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
    • capacity

      @QtUninvokable public final int capacity()
    • 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)
    • endsWith

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

      @QtUninvokable public final void fill(T t)
    • fill

      @QtUninvokable public final void fill(T t, int size)
    • 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)
    • insert

      @QtUninvokable public final void insert(int i, int n, 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 QVector<T> mid(int pos)
    • mid

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

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

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

      @QtUninvokable public final void remove(int i, int n)
    • 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)
    • resize

      @QtUninvokable public final void resize(int size)
    • squeeze

      @QtUninvokable public final void squeeze()
    • 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()
    • toSet

      @QtUninvokable public final QSet<T> toSet()
    • 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(QVector<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)
    • writeTo

      @QtUninvokable public void writeTo(QDataStream stream)

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

    • readFrom

      @QtUninvokable public void readFrom(QDataStream stream)

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

    • of

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    • swap

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

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

    • isSharedWith

      @QtUninvokable public final boolean isSharedWith(QVector<?> 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.
    • 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