Provides Facade objects for working with the algorithm functors, and a variety of utility iterators for various purposes.

The functionality that is adapted from STL is provided by a set of functors in the net.sf.jga.fn.algorithm package operate on iterators. To ease the transition to this approach, there are two facade objects whose methods correspond to the algorithms provided by STL.

The first, Algorithms, operates on collections, and is appropriate for getting easy answers to common questions over collections. The second, Iterators, is closer conceptually to the implementation, and is more appropriate if the same function is to be called several times for a given collection. Most of the methods in these two facades are a single logical statement (although sometimes the singe statement is broken up for formatting reasons) that constructs and invokes the appropriate algorithm functor.

The summary of the functions adapted from STL is as follows:
STL Function nameFacade method namefunctor
accumulate()accumulate()Accumulate
adjacentDiff()adjacentDiff()TransformAdjacent(Minus)
adjacent_find()findAdjacent()FindAdjacent
count()count()Count
count_if()count()Count
equal()equal()varies based on form (3)
find()find()Find
find_first_of()findElement()FindElement
find_if()find()Find
for_each()forEach()ForEach (2)
lexicographical_compare()lessThan()varies based on form (3)
max()maximum()Find,MaxValue (4)
max_element()maximumValue()MaxValue [collection]
Accumulate [iteration]
merge()merge()Merge
min()minimum()Find,MinValue (4)
min_element()minimumValue()MaxValue [collection]
Accumulate [iteration]
mismatch()mismatch()FindMismatch
remove()removeAlln/a(5)
remove_if()removeAllRemoveAll
remove_copy()removeAllCopyRemoveAll(6)
remove_copy_if()removeAllCopyRemoveAll(6)
replace()replaceAlln/a(5)
replace_if()replaceAllReplaceAll
replace_copy()replaceAllCopyReplaceAll(6)
replace_copy_if()replaceAllCopyReplaceAll(6)
search()match()FindSequence
search_n()findRepeated()FindRepeated
transform (unary form)transformCopyTransformUnary
transform (binary form)transformCopyTransformUnary
unique()uniquen/a(5)
unique_copy()uniqueCopyUnique(6)
(2) - The ForEach functor returns the result of the final call to the given functor, where the method returns the given functor.
(3) - The comparison operations are not implemented in terms of functors found in net.sf.jga.fn.algorithm: they are generally implemented via Comparators defined in net.sf.jga.util and comparison functors from net.sf.jga.fn.comparison.
(4) - Only supported for collections, not for iterations. Again, we'd need to be able to clone iterators in order to support them.
(5) - Works with Lists only (not general Collections). The only option available for updating in place is via a ListIterator.
(6) - Unlike C++, the X_copy forms append to the output collection, instead of overwriting it. In C++, the implementations can't assume the right to enlarge the output collection (it might be an array or some other fixed size structure) while in Java, the collections aren't inherently fixed size (if the user passes a fixed size or capped size collection to one of these methods, we'll pass through the appropriate exception, if necessary)