Package org.apache.calcite.util
Class ImmutableNullableSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.apache.calcite.util.ImmutableNullableSet<E>
- Type Parameters:
- E- Element type
- All Implemented Interfaces:
- Iterable<E>,- Collection<E>,- Set<E>
An immutable set that may contain null values.
 
If the set cannot contain null values, use ImmutableSet.
 
We do not yet support sorted sets.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classA builder for creating immutable nullable set instances.
- 
Method SummaryModifier and TypeMethodDescriptionstatic <E> ImmutableNullableSet.Builder<E>builder()Returns a new builder.booleanstatic <E> Set<E>copyOf(E[] elements) Returns an immutable set containing the given elements.static <E> Set<E>Returns an immutable set containing the given elements.iterator()static <E> Set<E>of(E e1) Creates an immutable set of 1 element.static <E> Set<E>of(E e1, E e2) Creates an immutable set of 2 elements.static <E> Set<E>of(E e1, E e2, E e3) Creates an immutable set of 3 elements.static <E> Set<E>of(E e1, E e2, E e3, E e4) Creates an immutable set of 4 elements.static <E> Set<E>of(E e1, E e2, E e3, E e4, E e5, E... others) Creates an immutable set of 5 or more elements.booleanbooleanremoveAll(Collection<?> c) intsize()Methods inherited from class java.util.AbstractSetequals, hashCodeMethods inherited from class java.util.AbstractCollectionadd, addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Setadd, addAll, clear, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
- 
Method Details- 
iterator
- 
sizepublic int size()- Specified by:
- sizein interface- Collection<E>
- Specified by:
- sizein interface- Set<E>
- Specified by:
- sizein class- AbstractCollection<E>
 
- 
contains- Specified by:
- containsin interface- Collection<E>
- Specified by:
- containsin interface- Set<E>
- Overrides:
- containsin class- AbstractCollection<E>
 
- 
remove- Specified by:
- removein interface- Collection<E>
- Specified by:
- removein interface- Set<E>
- Overrides:
- removein class- AbstractCollection<E>
 
- 
removeAll- Specified by:
- removeAllin interface- Collection<E>
- Specified by:
- removeAllin interface- Set<E>
- Overrides:
- removeAllin class- AbstractSet<E>
 
- 
copyOfReturns an immutable set containing the given elements.Behavior is as ImmutableSet.copyOf(Iterable)except that this set allows nulls.
- 
copyOfReturns an immutable set containing the given elements.Behavior as ImmutableSet.copyOf(Object[])except that this set allows nulls.
- 
ofCreates an immutable set of 1 element.
- 
ofCreates an immutable set of 2 elements.
- 
ofCreates an immutable set of 3 elements.
- 
ofCreates an immutable set of 4 elements.
- 
ofCreates an immutable set of 5 or more elements.
- 
builderReturns a new builder. The generated builder is equivalent to the builder created by theImmutableNullableSet.Builderconstructor.
 
-