Package org.javacord.core.util
Class VavrSetView<E>
- java.lang.Object
-
- org.javacord.core.util.VavrSetView<E>
-
- Type Parameters:
E
- The type of elements maintained by this set.
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
public class VavrSetView<E> extends java.lang.Object implements java.util.Set<E>
An immutable view that maps a Vavr set to a Java set.
-
-
Constructor Summary
Constructors Constructor Description VavrSetView(io.vavr.collection.Set<E> vavrSet, boolean unmodifiable)
Creates a new Vavr set view.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(java.util.Collection<? extends E> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
-
-
-
Constructor Detail
-
VavrSetView
public VavrSetView(io.vavr.collection.Set<E> vavrSet, boolean unmodifiable)
Creates a new Vavr set view.- Parameters:
vavrSet
- The Vavr set.unmodifiable
- Whether the view should be modifiable or not.
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
iterator
public java.util.Iterator<E> iterator()
Implementation Note: Modifications to the underlying set do not affect the
Iterator.hasNext()
andIterator.next()
methods.
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(E e)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
-