| java.lang.Object net.sf.jga.algorithms.Transform
All known Subclasses: net.sf.jga.util.TransformIterator, net.sf.jga.util.TransformAdjacentIterator, net.sf.jga.util.TransformBinaryIterator,
Transform | public class Transform (Code) | | Algorithms that process the elements of a collection, iteration, or iterable resource,
and present the results.
Copyright © 2002-2006 David A. Hall
author: David A. Hall |
Inner Class :public static class TransformIterable implements Iterable<R> | |
Inner Class :public static class TransformIterator implements Iterator<R> | |
Inner Class :public static class AdjacentIterable implements Iterable<R> | |
Inner Class :public static class AdjacentIterator implements Iterator<R> | |
Inner Class :public static class BinaryIterable implements Iterable<R> | |
Inner Class :public static class BinaryIterator implements Iterator<R> | |
Method Summary | |
public static Iterable<T> | replace(T[] ts, T value, T replacement) Produces an iterable over the contents of the array, such that all instances of the
given value are replaced with the given replacement value. | public static Iterable<T> | replace(T[] ts, UnaryFunctor<T, Boolean> test, T replacement) Produces an iterable over the contents of the array, such that all elements for which
the given test returns TRUE are replaced with the given replacement value. | public static Iterable<T> | replace(T[] ts, UnaryFunctor<T, Boolean> test, UnaryFunctor<T, T> fn) Produces an iterable over the contents of the array, such that all elements for which
the given test returns TRUE are replaced with the results of passing that element to
the given replacement functor. | public static Iterable<T> | replace(Iterable<T> ts, T value, T replacement) Produces an iterable over the contents of the input, such that all instances of the
given value are replaced with the given replacement value. | public static Iterable<T> | replace(Iterable<T> ts, UnaryFunctor<T, Boolean> test, T replacement) Produces an iterable over the contents of the input, such that all elements for which
the given test returns TRUE are replaced with the given replacement value. | public static Iterable<T> | replace(Iterable<T> ts, UnaryFunctor<T, Boolean> test, UnaryFunctor<T, T> fn) Produces an iterable over the contents of the input, such that all elements for which
the given test returns TRUE are replaced with the results of passing that element to
the given replacement functor. | public static Iterator<T> | replace(Iterator<? extends T> ts, T value, T replacement) Produces an iterator over the contents of the given iterator, such that all instances of the
given value are replaced with the given replacement value. | public static Iterator<T> | replace(Iterator<? extends T> ts, UnaryFunctor<T, Boolean> test, T replacement) Produces an iterator over the contents of the given iterator, such that all elements for which
the given test returns TRUE are replaced with the given replacement value. | public static Iterator<T> | replace(Iterator<? extends T> ts, UnaryFunctor<T, Boolean> test, UnaryFunctor<T, T> fn) Produces an iterator over the contents of the given iterator, such that all elements for which
the given test returns TRUE are replaced with the results of passing that element to
the given replacement functor. | public static TCollection | replace(Iterable<? extends T> cin, T value, T repl, TCollection cout) | public static TCollection | replace(Iterable<? extends T> cin, UnaryFunctor<T, Boolean> test, T repl, TCollection cout) Appends the contents of the input to the output, such that all elements for which
the given test returns TRUE are replaced with the given replacement value. | public static TCollection | replace(Iterable<? extends T> cin, UnaryFunctor<T, Boolean> test, UnaryFunctor<T, T> fn, TCollection cout) Appends the contents of the input to the output, such that all elements for which
the given test returns TRUE are replaced with the results of passing that element to
the given replacement functor. | public static Iterable<R> | transform(T[] ts, UnaryFunctor<T, R> fn) | public static Iterable<R> | transform(T[] ts, BinaryFunctor<T, T, R> fn) | public static Iterable<R> | transform(T1[] ts1, T2[] ts2, BinaryFunctor<T1, T2, R> fn) | public static Iterable<R> | transform(Iterable<? extends T> i, UnaryFunctor<T, R> fn) | public static Iterable<R> | transform(Iterable<? extends T> i, BinaryFunctor<T, T, R> fn) | public static Iterable<R> | transform(Iterable<? extends T1> i1, Iterable<? extends T2> i2, BinaryFunctor<T1, T2, R> fn) | public static Iterator<R> | transform(Iterator<? extends T> iter, UnaryFunctor<T, R> fn) | public static Iterator<R> | transform(Iterator<? extends T> iter, BinaryFunctor<T, T, R> fn) | public static Iterator<R> | transform(Iterator<? extends T1> iter1, Iterator<? extends T2> iter2, BinaryFunctor<T1, T2, R> fn) | public static RCollection | transform(Iterable<? extends T> cin, UnaryFunctor<T, R> fn, RCollection cout) Appends the transformed contents of the input to the output. | public static RCollection | transform(Iterable<? extends T> cin, BinaryFunctor<T, T, R> fn, RCollection cout) Appends the results of transforming successive pairs of elements from the input to the output. | public static RCollection | transform(Iterable<? extends T1> cin1, Iterable<? extends T2> cin2, BinaryFunctor<T1, T2, R> fn, RCollection cout) Appends the results of transforming corresponding pairs of elements from the
input sto the output. |
replace | public static Iterable<T> replace(T[] ts, T value, T replacement)(Code) | | Produces an iterable over the contents of the array, such that all instances of the
given value are replaced with the given replacement value.
|
replace | public static Iterable<T> replace(T[] ts, UnaryFunctor<T, Boolean> test, T replacement)(Code) | | Produces an iterable over the contents of the array, such that all elements for which
the given test returns TRUE are replaced with the given replacement value.
|
replace | public static Iterable<T> replace(T[] ts, UnaryFunctor<T, Boolean> test, UnaryFunctor<T, T> fn)(Code) | | Produces an iterable over the contents of the array, such that all elements for which
the given test returns TRUE are replaced with the results of passing that element to
the given replacement functor.
|
replace | public static Iterable<T> replace(Iterable<T> ts, T value, T replacement)(Code) | | Produces an iterable over the contents of the input, such that all instances of the
given value are replaced with the given replacement value.
|
replace | public static Iterable<T> replace(Iterable<T> ts, UnaryFunctor<T, Boolean> test, T replacement)(Code) | | Produces an iterable over the contents of the input, such that all elements for which
the given test returns TRUE are replaced with the given replacement value.
|
replace | public static Iterable<T> replace(Iterable<T> ts, UnaryFunctor<T, Boolean> test, UnaryFunctor<T, T> fn)(Code) | | Produces an iterable over the contents of the input, such that all elements for which
the given test returns TRUE are replaced with the results of passing that element to
the given replacement functor.
|
replace | public static Iterator<T> replace(Iterator<? extends T> ts, T value, T replacement)(Code) | | Produces an iterator over the contents of the given iterator, such that all instances of the
given value are replaced with the given replacement value.
|
replace | public static Iterator<T> replace(Iterator<? extends T> ts, UnaryFunctor<T, Boolean> test, T replacement)(Code) | | Produces an iterator over the contents of the given iterator, such that all elements for which
the given test returns TRUE are replaced with the given replacement value.
|
replace | public static Iterator<T> replace(Iterator<? extends T> ts, UnaryFunctor<T, Boolean> test, UnaryFunctor<T, T> fn)(Code) | | Produces an iterator over the contents of the given iterator, such that all elements for which
the given test returns TRUE are replaced with the results of passing that element to
the given replacement functor.
|
replace | public static TCollection replace(Iterable<? extends T> cin, T value, T repl, TCollection cout)(Code) | | Appends the contents of the input to the output, such that all instances of the
given value are replaced with the given replacement value
|
replace | public static TCollection replace(Iterable<? extends T> cin, UnaryFunctor<T, Boolean> test, T repl, TCollection cout)(Code) | | Appends the contents of the input to the output, such that all elements for which
the given test returns TRUE are replaced with the given replacement value.
|
replace | public static TCollection replace(Iterable<? extends T> cin, UnaryFunctor<T, Boolean> test, UnaryFunctor<T, T> fn, TCollection cout)(Code) | | Appends the contents of the input to the output, such that all elements for which
the given test returns TRUE are replaced with the results of passing that element to
the given replacement functor.
|
transform | public static Iterable<R> transform(T[] ts, UnaryFunctor<T, R> fn)(Code) | | Passes each element in the array to the functor, iterating over the results
|
transform | public static Iterable<R> transform(T[] ts, BinaryFunctor<T, T, R> fn)(Code) | | Passes successive pairs of elements in the array to the functor, iterating over the results
|
transform | public static Iterable<R> transform(T1[] ts1, T2[] ts2, BinaryFunctor<T1, T2, R> fn)(Code) | | Passes corresponding pairs of elements in the arrays to the functor,
iterating over the results
|
transform | public static Iterable<R> transform(Iterable<? extends T> i, UnaryFunctor<T, R> fn)(Code) | | Passes each element in the iterable resource to the functor, iterating over the results
|
transform | public static Iterable<R> transform(Iterable<? extends T> i, BinaryFunctor<T, T, R> fn)(Code) | | Passes successive pairs of elements in the iterable resource to the functor,
iterating over the results
|
transform | public static Iterable<R> transform(Iterable<? extends T1> i1, Iterable<? extends T2> i2, BinaryFunctor<T1, T2, R> fn)(Code) | | Passes corresponding pairs of elements in the iterable resources to the functor,
iterating over the results
|
transform | public static Iterator<R> transform(Iterator<? extends T> iter, UnaryFunctor<T, R> fn)(Code) | | Passes each element in the iterator to the functor, iterating over the results
|
transform | public static Iterator<R> transform(Iterator<? extends T> iter, BinaryFunctor<T, T, R> fn)(Code) | | Passes successive pairs of elements in the iterator to the functor, iterating over the results
|
transform | public static Iterator<R> transform(Iterator<? extends T1> iter1, Iterator<? extends T2> iter2, BinaryFunctor<T1, T2, R> fn)(Code) | | Passes corresponding pairs of elements in the iterators to the functor,
iterating over the results
|
transform | public static RCollection transform(Iterable<? extends T> cin, UnaryFunctor<T, R> fn, RCollection cout)(Code) | | Appends the transformed contents of the input to the output.
|
transform | public static RCollection transform(Iterable<? extends T> cin, BinaryFunctor<T, T, R> fn, RCollection cout)(Code) | | Appends the results of transforming successive pairs of elements from the input to the output.
|
transform | public static RCollection transform(Iterable<? extends T1> cin1, Iterable<? extends T2> cin2, BinaryFunctor<T1, T2, R> fn, RCollection cout)(Code) | | Appends the results of transforming corresponding pairs of elements from the
input sto the output.
|
|
|