public interface Enumeration
GDK enhancements for Enumeration.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
asBoolean()Coerce an enumeration instance to a boolean value. |
<T> |
public Iterator<T> |
iterator()Allows an Enumeration to behave like an Iterable. |
<T> |
public Stream<T> |
stream()Returns a sequential Stream with the specified element(s) as its source. |
<T> |
public List<T> |
toList()Convert an enumeration to a List. |
<T> |
public Set<T> |
toSet()Convert an enumeration to a Set. |
Coerce an enumeration instance to a boolean value. An enumeration is coerced to false if there are no more elements to enumerate, and to true otherwise.
Allows an Enumeration to behave like an Iterable. Note that the Iterator.remove method is unsupported since the underlying Enumeration doesn't provide a mechanism for removing items.
Returns a sequential Stream with the specified element(s) as its source.
def tokens = new StringTokenizer('one two')
assert tokens.stream().toList() == ['one', 'two']
Convert an enumeration to a List.
Convert an enumeration to a Set.