net.fortytwo.flow
Class Buffer<T>
java.lang.Object
net.fortytwo.flow.Collector<T>
net.fortytwo.flow.Buffer<T>
- Type Parameters:
T - the type of data being passed
- All Implemented Interfaces:
- Iterable<T>, Collection<T>, Sink<T>, Source<T>
public class Buffer<T>
- extends Collector<T>
A collection of data items which grows until "flushed" to a downstream sink.
- Author:
- Joshua Shinavier (http://fortytwo.net)
|
Constructor Summary |
Buffer(Sink<T> sink)
Constructs a new buffer of the given type |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Buffer
public Buffer(Sink<T> sink)
- Constructs a new buffer of the given type
- Parameters:
sink - the downstream sink to which to pass the received data items when the buffer is flushed
flush
public void flush()
throws RippleException
- Empties the buffer, pushing the collected data items in FIFO order to the downstream sink
- Throws:
RippleException
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Collection<T>
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection<T>
toArray
public T[] toArray()
- Specified by:
toArray in interface Collection<T>
toArray
public <U> U[] toArray(U[] array)
- Specified by:
toArray in interface Collection<T>
add
public boolean add(T t)
- Specified by:
add in interface Collection<T>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<T>
containsAll
public boolean containsAll(Collection<?> objects)
- Specified by:
containsAll in interface Collection<T>
addAll
public boolean addAll(Collection<? extends T> ts)
- Specified by:
addAll in interface Collection<T>
removeAll
public boolean removeAll(Collection<?> objects)
- Specified by:
removeAll in interface Collection<T>
retainAll
public boolean retainAll(Collection<?> objects)
- Specified by:
retainAll in interface Collection<T>
Copyright © 2007-2014. All Rights Reserved.