public class PipeHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areEqual(Iterator ittyA,
Iterator ittyB)
Checks if the contents of the two iterators are equal and of the same length.
|
static long |
counter(Iterator iterator)
Count the number of objects in an iterator.
|
static PipeFunction |
createPipeFunction(Class clazz,
String methodName,
Class... argumentTypes)
Create a PipeFunction for a static method.
|
static PipeFunction |
createPipeFunction(Method method)
Create a PipeFunction for a static method.
|
static <T> Iterator<T> |
emptyIterator() |
static <T> void |
fillCollection(Iterator<T> iterator,
Collection<T> collection)
Drain an iterator into a collection.
|
static <T> void |
fillCollection(Iterator<T> iterator,
Collection<T> collection,
int number)
Drain an iterator into a collection.
|
static <T> void |
iterate(Iterator<T> iterator)
This will iterate all the objects out of the iterator.
|
static <T> List<T> |
makeList(Iterator<T> iterator)
Drains the iterator into a list that is returned by the method.
|
static String |
makePipeString(Pipe pipe,
Object... arguments)
Generate a String representation of a pipe given the pipe and some arguments of the pipe.
|
public static <T> void iterate(Iterator<T> iterator)
iterator - the iterator to drainpublic static <T> void fillCollection(Iterator<T> iterator, Collection<T> collection)
T - the object type of the iteratoriterator - the iterator to draincollection - the collection to fillpublic static <T> void fillCollection(Iterator<T> iterator, Collection<T> collection, int number)
T - the object type of the iteratoriterator - the iterator to draincollection - the collection to fillnumber - the number of objects to fill into the collection (ordered by iterator)public static <T> List<T> makeList(Iterator<T> iterator)
T - the object type of the iteratoriterator - the iterator to drain into the listpublic static long counter(Iterator iterator)
iterator - the iterator to countpublic static boolean areEqual(Iterator ittyA, Iterator ittyB)
ittyA - An iteratorittyB - An iteratorpublic static String makePipeString(Pipe pipe, Object... arguments)
pipe - the pipe's class.getSimpleName() is usedarguments - arguments used in the configuration of the pipe (please avoid objects with massive toString() representations)public static PipeFunction createPipeFunction(Method method)
method - a single argument, static method that will be invoked for when PipeFunction.compute() is calledpublic static PipeFunction createPipeFunction(Class clazz, String methodName, Class... argumentTypes)
clazz - the class hosting the methodmethodName - the string representation of the methodargumentTypes - the classes of the argumentspublic static <T> Iterator<T> emptyIterator()
Copyright © 2010-2014. All Rights Reserved.