public class NonEmptySet<T>
A set which is constrained to ensure it can never be empty. An initial value must be provided at construction, and attempting to remove the last element will cause an IllegalStateException. The underlying set is exposed for Kryo to access, but should not be accessed directly.
Modifier and Type | Class and Description |
---|---|
class |
NonEmptySet.Iterator<T> |
Constructor and Description |
---|
NonEmptySet(T initial)
A set which is constrained to ensure it can never be empty. An initial value must be provided at
construction, and attempting to remove the last element will cause an IllegalStateException.
The underlying set is exposed for Kryo to access, but should not be accessed directly.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(T element) |
boolean |
addAll(java.util.Collection<? extends T> elements) |
java.lang.Void |
clear() |
boolean |
contains(java.lang.Object element) |
boolean |
containsAll(java.util.Collection<? extends java.lang.Object> elements) |
boolean |
equals(java.lang.Object other) |
int |
getSize() |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
boolean |
remove(java.lang.Object element) |
boolean |
removeAll(java.util.Collection<? extends java.lang.Object> elements) |
boolean |
retainAll(java.util.Collection<? extends java.lang.Object> elements) |
int |
size() |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] p) |
java.lang.String |
toString() |
public NonEmptySet(T initial)
A set which is constrained to ensure it can never be empty. An initial value must be provided at construction, and attempting to remove the last element will cause an IllegalStateException. The underlying set is exposed for Kryo to access, but should not be accessed directly.
public int getSize()
public int size()
public boolean add(T element)
public boolean addAll(java.util.Collection<? extends T> elements)
public java.lang.Void clear()
public boolean contains(java.lang.Object element)
public boolean containsAll(java.util.Collection<? extends java.lang.Object> elements)
public boolean isEmpty()
public java.util.Iterator<T> iterator()
public boolean remove(java.lang.Object element)
public boolean removeAll(java.util.Collection<? extends java.lang.Object> elements)
public boolean retainAll(java.util.Collection<? extends java.lang.Object> elements)
public boolean equals(java.lang.Object other)
public int hashCode()
public java.lang.String toString()
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] p)