java.lang.Object
io.qt.QtObject
io.qt.core.QSet<T>
- All Implemented Interfaces:
QtObjectInterface
,Cloneable
,Iterable<T>
,Collection<T>
,Set<T>
Java wrapper for Qt class QSet
-
Nested Class Summary
Nested classes/interfaces inherited from class io.qt.QtObject
QtObject.QPrivateConstructor
-
Constructor Summary
ConstructorDescriptionCreating a container with given element type.QSet
(QMetaType.Type metaType) Creating a container with given element type.Creating a container with given element type.QSet
(Collection<T> other) Creating a container with given content. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Adds the specified element to this set if it is not already present (optional operation).boolean
addAll
(Collection<? extends T> c) Adds all of the elements in the specified collection to this container.final int
capacity()
final void
clear()
SeeQSet::
clear() 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 boolean
final boolean
containsAll
(Collection<?> c) Returnstrue
if this container contains all of the elements in the specified collection.final int
count()
boolean
int
hashCode()
Returns the objects's hash code computed byqHash(QSet<T>)
.final void
SeeQSet::
insert(T) final void
intersect
(Collection<T> other) final boolean
intersects
(Collection<T> other) final boolean
isEmpty()
iterator()
Returns an iterator over elements of typeT
.static <T> QSet<T>
of
(T element0, T... elements) Returns a QSet containing given elements.void
readFrom
(QDataStream stream) final boolean
SeeQSet::
remove(T) final boolean
removeAll
(Collection<?> c) Removes all of this container elements that are also contained in the specified collection.final boolean
final void
reserve
(int size) boolean
retainAll
(Collection<?> c) Retains only the elements in this container that are contained in the specified collection.final int
size()
final void
subtract
(Collection<T> other) final Object[]
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.toString()
Returns the string representation of the object given byQVariant(this).toString()
.final void
unite
(Collection<T> other) values()
void
writeTo
(QDataStream stream) 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, stream, toArray
Methods inherited from interface java.util.Set
addAll, containsAll, iterator, removeAll, retainAll, spliterator, toArray, toArray
-
Constructor Details
-
QSet
Creating a container with given element type.See
QSet::
QSet() - Parameters:
elementType
- the type T
-
QSet
Creating a container with given element type.See
QSet::
QSet() - Parameters:
metaType
- the type T
-
QSet
Creating a container with given element type.See
QSet::
QSet() - Parameters:
metaType
- the type T
-
QSet
Creating a container with given content.- Parameters:
other
- container
-
-
Method Details
-
clone
Creates and returns a copy of this object. -
constBegin
Provides a constant C++ iterator to the containers begin.- Returns:
- begin
-
capacity
-
clear
See
QSet::
clear() -
contains
-
count
-
constEnd
Provides a constant C++ iterator to the containers end.- Returns:
- end
-
insert
See
QSet::
insert(T) -
intersect
-
intersects
-
isEmpty
-
remove
See
QSet::
remove(T) -
removeIf
- Specified by:
removeIf
in interfaceCollection<T>
-
reserve
-
size
-
subtract
-
unite
-
values
-
equals
-
hashCode
Returns the objects's hash code computed byqHash(QSet<T>)
. -
toString
Returns the string representation of the object given byQVariant(this).toString()
.- Returns:
- String
-
add
Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified elemente
to this set if the set contains no elemente2
such thatObjects.equals(e, e2)
. If this set already contains the element, the call leaves the set unchanged and returnsfalse
. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements. -
writeTo
-
readFrom
-
of
Returns a QSet containing given elements.- Type Parameters:
T
- theQSet
's element type- Parameters:
element0
- the first elementelements
- subsequent elements- Returns:
- a
QSet
containing the specified element - Throws:
NullPointerException
- if elements arenull
-
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>
-
addAll
Adds all of the elements in the specified collection to this container.- Specified by:
addAll
in interfaceCollection<T>
-
removeAll
Removes all of this container elements that are also contained in the specified collection.- Specified by:
removeAll
in interfaceCollection<T>
-
retainAll
Retains only the elements in this container that are contained in the specified collection.- Specified by:
retainAll
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
-