All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.algorithms.Transforming

java.lang.Object
   |
   +----COM.objectspace.jgl.algorithms.Transforming

public final class Transforming
extends Object
The Transforming class contains generic transforming algorithms.

See Also:
TransformingExamples

Method Index

 o collect(Container, UnaryFunction)
Return a container that is the same class as the original and contains the result of applying the given unary function to each element in the original.
 o collect(ForwardIterator, ForwardIterator, UnaryFunction)
Return a container that is the same class as the original and contains the result of applying the given unary function to each element in the range.
 o transform(Container, Container, Container, BinaryFunction)
Traverse two containers and add the results of invoking a BinaryFunction on corresponding elements to another container.
 o transform(Container, Container, OutputIterator, BinaryFunction)
Traverse two containers and store the results of invoking a BinaryFunction on corresponding elements into a sequence.
 o transform(Container, Container, UnaryFunction)
Traverse a container and add the results of invoking a UnaryFunction on each element into another container.
 o transform(Container, OutputIterator, UnaryFunction)
Traverse a container and store the results of invoking a UnaryFunction on each element into a sequence.
 o transform(InputIterator, InputIterator, InputIterator, OutputIterator, BinaryFunction)
Traverse two sequences and store the results of invoking a BinaryFunction on corresponding elements into another sequence of the same size.
 o transform(InputIterator, InputIterator, OutputIterator, UnaryFunction)
Traverse a sequence and store the results of invoking a UnaryFunction on each element into another sequence of the same size.

Methods

 o transform
 public static OutputIterator transform(InputIterator first,
                                        InputIterator last,
                                        OutputIterator result,
                                        UnaryFunction function)
Traverse a sequence and store the results of invoking a UnaryFunction on each element into another sequence of the same size. The time complexity is linear and the space complexity is constant.

Parameters:
first - An iterator positioned at the first element of the input sequence.
last - An iterator positioned immediately after the last element of the input sequence.
result - An iterator positioned at the first element of the output sequence.
function - A uanry function.
Returns:
An iterator positioned immediately after the last element of the output sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o transform
 public static OutputIterator transform(Container input,
                                        OutputIterator result,
                                        UnaryFunction function)
Traverse a container and store the results of invoking a UnaryFunction on each element into a sequence. The time complexity is linear and the space complexity is constant.

Parameters:
input - The input container.
result - An iterator positioned at the first element of the output sequence.
function - A unary function.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o transform
 public static void transform(Container source,
                              Container destination,
                              UnaryFunction function)
Traverse a container and add the results of invoking a UnaryFunction on each element into another container. The time complexity is linear and the space complexity is constant.

Parameters:
source - The source container.
desination - The destination container.
function - A unary function.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o transform
 public static OutputIterator transform(InputIterator first1,
                                        InputIterator last1,
                                        InputIterator first2,
                                        OutputIterator result,
                                        BinaryFunction function)
Traverse two sequences and store the results of invoking a BinaryFunction on corresponding elements into another sequence of the same size. Stop when the end of the first sequence is reached. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first input sequence.
last1 - An iterator positioned immediately after the last element of the first input sequence.
first2 - An iterator positioned at the first element of the second input sequence.
result - An iterator positioned at the first element of the output sequence.
function - A binary function.
Returns:
An iterator positioned immediately after the last element of the output sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o transform
 public static OutputIterator transform(Container input1,
                                        Container input2,
                                        OutputIterator result,
                                        BinaryFunction function)
Traverse two containers and store the results of invoking a BinaryFunction on corresponding elements into a sequence. Stop when the end of the first container is reached. The time complexity is linear and the space complexity is constant.

Parameters:
input1 - The first input container.
input2 - The second input container.
result - An iterator positioned at the first element of the output sequence.
function - A binary function.
Returns:
An iterator positioned immediately after the last element of the output container.
 o transform
 public static void transform(Container input1,
                              Container input2,
                              Container output,
                              BinaryFunction function)
Traverse two containers and add the results of invoking a BinaryFunction on corresponding elements to another container. Stop when the end of the first container is reached. The time complexity is linear and the space complexity is constant.

Parameters:
input1 - The first input container.
input2 - The second input container.
output - The output container.
function - A binary function.
Returns:
An iterator positioned immediately after the last element of the output container.
 o collect
 public static Container collect(ForwardIterator first,
                                 ForwardIterator last,
                                 UnaryFunction function)
Return a container that is the same class as the original and contains the result of applying the given unary function to each element in the range. The original container is not modified.

Parameters:
first - An iterator positioned at the first element in the range.
last - An iterator positioned immediately after the last element in the range.
function - A unary function.
Returns:
A new container that contains the result of applying the unary function.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o collect
 public static Container collect(Container container,
                                 UnaryFunction function)
Return a container that is the same class as the original and contains the result of applying the given unary function to each element in the original. The original container is not modified.

Parameters:
container - A container.
function - A unary function.
Returns:
A new container containing the result of applying the unary function.

All Packages  Class Hierarchy  This Package  Previous  Next  Index