Package net.morimekta.util.collect
Class UnmodifiableSet<E>
- java.lang.Object
-
- net.morimekta.util.collect.UnmodifiableCollection<E>
-
- net.morimekta.util.collect.UnmodifiableSet<E>
-
- Type Parameters:
E
- The set element type.
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
@Immutable public class UnmodifiableSet<E> extends UnmodifiableCollection<E> implements java.util.Set<E>
Simple immutable set. This set is order-preserving, so when iterating the elements, they will come in the same order as added. If same value was added multiple times, the first entry counts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UnmodifiableSet.Builder<E>
-
Field Summary
-
Fields inherited from class net.morimekta.util.collect.UnmodifiableCollection
array, length, offset
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <E> UnmodifiableSet.Builder<E>
builder()
static <E> UnmodifiableSet.Builder<E>
builder(int initialCapacity)
boolean
contains(java.lang.Object o)
static <E> UnmodifiableSet<E>
copyOf(E[] array)
static <E> UnmodifiableSet<E>
copyOf(java.lang.Iterable<? extends E> iterable)
static <E> UnmodifiableSet<E>
copyOf(java.util.Collection<? extends E> collection)
static <E> UnmodifiableSet<E>
copyOf(java.util.Enumeration<? extends E> enumeration)
static <E> UnmodifiableSet<E>
copyOf(java.util.Iterator<? extends E> iterator)
boolean
equals(java.lang.Object obj)
int
hashCode()
static <E> UnmodifiableSet<E>
setOf()
static <E> UnmodifiableSet<E>
setOf(E e)
static <E> UnmodifiableSet<E>
setOf(E e1, E e2)
static <E> UnmodifiableSet<E>
setOf(E e1, E e2, E e3)
static <E> UnmodifiableSet<E>
setOf(E e1, E e2, E e3, E e4)
static <E> UnmodifiableSet<E>
setOf(E e1, E e2, E e3, E e4, E e5)
static <E> UnmodifiableSet<E>
setOf(E e1, E e2, E e3, E e4, E e5, E e6)
static <E> UnmodifiableSet<E>
setOf(E e1, E e2, E e3, E e4, E e5, E e6, E e7)
static <E> UnmodifiableSet<E>
setOf(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)
static <E> UnmodifiableSet<E>
setOf(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)
static <E> UnmodifiableSet<E>
setOf(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E... more)
java.lang.String
toString()
-
Methods inherited from class net.morimekta.util.collect.UnmodifiableCollection
add, addAll, asList, clear, containsAll, isEmpty, iterator, remove, removeAll, removeIf, retainAll, size, toArray, toArray
-
-
-
-
Method Detail
-
copyOf
@Nonnull public static <E> UnmodifiableSet<E> copyOf(E[] array)
-
copyOf
@Nonnull public static <E> UnmodifiableSet<E> copyOf(java.lang.Iterable<? extends E> iterable)
-
copyOf
@Nonnull public static <E> UnmodifiableSet<E> copyOf(java.util.Iterator<? extends E> iterator)
-
copyOf
@Nonnull public static <E> UnmodifiableSet<E> copyOf(java.util.Enumeration<? extends E> enumeration)
-
copyOf
@Nonnull public static <E> UnmodifiableSet<E> copyOf(java.util.Collection<? extends E> collection)
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf()
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf(E e)
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf(E e1, E e2)
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf(E e1, E e2, E e3)
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf(E e1, E e2, E e3, E e4)
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf(E e1, E e2, E e3, E e4, E e5)
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf(E e1, E e2, E e3, E e4, E e5, E e6)
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf(E e1, E e2, E e3, E e4, E e5, E e6, E e7)
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)
-
setOf
@Nonnull public static <E> UnmodifiableSet<E> setOf(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)
-
setOf
@Nonnull @SafeVarargs public static <E> UnmodifiableSet<E> setOf(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E... more)
-
builder
@Nonnull public static <E> UnmodifiableSet.Builder<E> builder()
-
builder
@Nonnull public static <E> UnmodifiableSet.Builder<E> builder(int initialCapacity)
-
equals
public boolean equals(java.lang.Object obj)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<E>
- Specified by:
contains
in interfacejava.util.Set<E>
- Overrides:
contains
in classUnmodifiableCollection<E>
-
-