net.fortytwo.flow
Class Collector<T,E extends Exception>
java.lang.Object
net.fortytwo.flow.SimpleReadOnlyCollection<T>
net.fortytwo.flow.Collector<T,E>
- All Implemented Interfaces:
- Iterable<T>, Collection<T>, Sink<T,E>, Source<T,E>
- Direct Known Subclasses:
- Buffer
public class Collector<T,E extends Exception>
- extends SimpleReadOnlyCollection<T>
- implements Sink<T,E>, Source<T,E>
Note: while this class is not actually thread-safe, put() may safely be
called while writeTo() is in progress.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Collector
public Collector()
put
public void put(T t)
throws E extends Exception
- Specified by:
put in interface Sink<T,E extends Exception>
- Throws:
E extends Exception
writeTo
public void writeTo(Sink<T,E> sink)
throws E extends Exception
- Specified by:
writeTo in interface Source<T,E extends Exception>
- Throws:
E extends Exception
size
public int size()
- Specified by:
size in interface Collection<T>
iterator
public Iterator<T> iterator()
- Specified by:
iterator in interface Iterable<T>- Specified by:
iterator in interface Collection<T>
clear
public void clear()
- Specified by:
clear in interface Collection<T>- Overrides:
clear in class SimpleReadOnlyCollection<T>
Copyright © 2007-2011 fortytwo.net. All Rights Reserved.