| Constructor and Description |
|---|
MiniSet() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T e)
Modifying operation - not allowed.
|
boolean |
addAll(Collection<? extends T> c)
Modifying operation - not allowed.
|
void |
clear()
Modifying operation - not allowed.
|
boolean |
containsAll(Collection<?> c)
Test whether the collection contains all of the objects in a supplied
Collection. |
boolean |
equals(Object other)
Compares the specified object with this set for equality.
|
int |
hashCode()
Returns the hash code value for this set.
|
static <TT> MiniSet<TT> |
of()
Get an empty
MiniSet. |
static <TT> Set<TT> |
of(TT... values)
Get a
MiniSet with a variable number of values. |
static <TT> MiniSet<TT> |
of(TT value)
Get a
MiniSet containing a single value. |
static <TT> MiniSet<TT> |
of(TT value0,
TT value1)
Get a
MiniSet containing two values. |
static <TT> MiniSet<TT> |
of(TT value0,
TT value1,
TT value2)
Get a
MiniSet containing three values. |
static <TT> MiniSet<TT> |
of(TT value0,
TT value1,
TT value2,
TT value3)
Get a
MiniSet containing four values. |
static <TT> MiniSet<TT> |
of(TT value0,
TT value1,
TT value2,
TT value3,
TT value4)
Get a
MiniSet containing five values. |
boolean |
remove(Object o)
Modifying operation - not allowed.
|
boolean |
removeAll(Collection<?> c)
Modifying operation - not allowed.
|
boolean |
retainAll(Collection<?> c)
Modifying operation - not allowed.
|
protected String |
stringOf(Object obj)
Return a string representation of the supplied value, guarding against possible recursion.
|
String |
toString()
Returns a string representation of this collection.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, isEmpty, iterator, size, spliterator, toArray, toArrayparallelStream, removeIf, streampublic void clear()
clear in interface Collection<T>clear in interface Set<T>UnsupportedOperationException - (in all cases)public boolean add(T e)
add in interface Collection<T>add in interface Set<T>UnsupportedOperationException - (in all cases)public boolean addAll(Collection<? extends T> c)
addAll in interface Collection<T>addAll in interface Set<T>UnsupportedOperationException - (in all cases)public boolean remove(Object o)
remove in interface Collection<T>remove in interface Set<T>UnsupportedOperationException - (in all cases)public boolean containsAll(Collection<?> c)
Collection.containsAll in interface Collection<T>containsAll in interface Set<T>c - the other Collectiontrue if the collection contains all of the objects in the other Collectionpublic boolean removeAll(Collection<?> c)
removeAll in interface Collection<T>removeAll in interface Set<T>UnsupportedOperationException - (in all cases)public boolean retainAll(Collection<?> c)
retainAll in interface Collection<T>retainAll in interface Set<T>UnsupportedOperationException - (in all cases)public boolean equals(Object other)
true if the specified object is also a
set, the two sets have the same size, and every member of the specified set is contained in this set (or
equivalently, every member of this set is contained in the specified set). This definition ensures that the
equals method works properly across different implementations of the set interface.public int hashCode()
null element is defined to be zero. This ensures that
s1.equals(s2) implies that s1.hashCode() == s2.hashCode() for any two sets s1 and
s2, as required by the general contract of Object.hashCode().public String toString()
String.valueOf(Object).protected String stringOf(Object obj)
obj - the objectpublic static <TT> MiniSet<TT> of()
MiniSet.TT - the element typeMiniSetpublic static <TT> MiniSet<TT> of(TT value)
MiniSet containing a single value.TT - the element typevalue - the valueMiniSetpublic static <TT> MiniSet<TT> of(TT value0, TT value1)
MiniSet containing two values.TT - the element typevalue0 - the first valuevalue1 - the second valueMiniSetpublic static <TT> MiniSet<TT> of(TT value0, TT value1, TT value2)
MiniSet containing three values.TT - the element typevalue0 - the first valuevalue1 - the second valuevalue2 - the third valueMiniSetpublic static <TT> MiniSet<TT> of(TT value0, TT value1, TT value2, TT value3)
MiniSet containing four values.TT - the element typevalue0 - the first valuevalue1 - the second valuevalue2 - the third valuevalue3 - the fourth valueMiniSetpublic static <TT> MiniSet<TT> of(TT value0, TT value1, TT value2, TT value3, TT value4)
MiniSet containing five values.TT - the element typevalue0 - the first valuevalue1 - the second valuevalue2 - the third valuevalue3 - the fourth valuevalue4 - the fifth valueMiniSet@SafeVarargs public static <TT> Set<TT> of(TT... values)
MiniSet with a variable number of values.TT - the element typevalues - the valuesMiniSetCopyright © 2022. All rights reserved.