T
- Elements typepublic class ThrowSet<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<T> |
set
Elements list
|
Constructor and Description |
---|
ThrowSet()
Create a new instance of ThrowSet
|
Modifier and Type | Method and Description |
---|---|
boolean |
isEmpty()
Indicates if set is empty
|
int |
size()
Set size
|
T |
take()
Take an element from the set.
|
void |
throwElement(T element)
Add an element to the set
|
T[] |
toArray(T[] array)
Return the throw set to an array of element
|
java.lang.String |
toString()
String representation of the throw set
Parent documentation: |
private final java.util.ArrayList<T> set
public boolean isEmpty()
true
if set is emptypublic int size()
public T take()
public void throwElement(T element)
element
- Element to addpublic T[] toArray(T[] array)
array
- Array to store the resultpublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()