All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.algorithms.MinMax

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

public final class MinMax
extends Object
The MinMax class contains generic min/max algorithms.

See Also:
MinMaxExamples

Method Index

 o maxElement(Container)
Find the maximum element in a container.
 o maxElement(Container, BinaryPredicate)
Find the maximum element in a container.
 o maxElement(InputIterator, InputIterator)
Find the maximum element in a sequence.
 o maxElement(InputIterator, InputIterator, BinaryPredicate)
Find the maximum element in a sequence.
 o minElement(Container)
Find the minimum element in a container.
 o minElement(Container, BinaryPredicate)
Find the minimum element in a container.
 o minElement(InputIterator, InputIterator)
Find the minimum element in a sequence.
 o minElement(InputIterator, InputIterator, BinaryPredicate)
Find the minimum element in a sequence.

Methods

 o maxElement
 public static InputIterator maxElement(InputIterator first,
                                        InputIterator last)
Find the maximum element in a sequence. Compare objects based on the hash code. The time complexity is linear and the space complexity is constant.

Parameters:
first - An iterator positioned at the first element in the sequence.
last - An iterator positioned immediately after the last element in the sequence.
Returns:
An iterator positioned at the maximum element in the sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o maxElement
 public static InputIterator maxElement(Container container)
Find the maximum element in a container. Compare objects based on the hash code. The time complexity is linear and the space complexity is constant.

Parameters:
container - The container.
last - An iterator positioned immediately after the last element in the sequence.
Returns:
An iterator positioned at the maximum element in the container.
 o maxElement
 public static InputIterator maxElement(InputIterator first,
                                        InputIterator last,
                                        BinaryPredicate comparator)
Find the maximum element in a sequence. Use a comparator to perform the comparison. The time complexity is linear and the space complexity is constant.

Parameters:
first - An iterator positioned at the first element in the sequence.
last - An iterator positioned immediately after the last element in the sequence.
comparator - A binary predicate that returns true if the first operand is "less" than the second operand.
Returns:
An iterator positioned at the maximum element in the sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o maxElement
 public static InputIterator maxElement(Container container,
                                        BinaryPredicate comparator)
Find the maximum element in a container. Use a comparator to perform the comparison. The time complexity is linear and the space complexity is constant.

Parameters:
container - The container.
comparator - A binary predicate that returns true if the first operand is "less" than the second operand.
Returns:
An iterator positioned at the maximum element in the container.
 o minElement
 public static InputIterator minElement(InputIterator first,
                                        InputIterator last)
Find the minimum element in a sequence. Compare objects based on the hash code. The time complexity is linear and the space complexity is constant.

Parameters:
first - An iterator positioned at the first element in the sequence.
last - An iterator positioned immediately after the last element in the sequence.
Returns:
An iterator positioned at the minimum element in the sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o minElement
 public static InputIterator minElement(Container container)
Find the minimum element in a container. Compare objects based on the hash code. The time complexity is linear and the space complexity is constant.

Parameters:
container - The container.
Returns:
An iterator positioned at the minimum element in the container.
 o minElement
 public static InputIterator minElement(InputIterator first,
                                        InputIterator last,
                                        BinaryPredicate comparator)
Find the minimum element in a sequence. Use a comparator to perform the comparison. The time complexity is linear and the space complexity is constant.

Parameters:
first - An iterator positioned at the first element in the sequence.
last - An iterator positioned immediately after the last element in the sequence.
comparator - A binary predicate that returns true if the first operand is "less" than the second operand.
Returns:
An iterator positioned at the minimum element in the sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o minElement
 public static InputIterator minElement(Container container,
                                        BinaryPredicate comparator)
Find the minimum element in a container. Use a comparator to perform the comparison. The time complexity is linear and the space complexity is constant.

Parameters:
container - The container.
comparator - A binary predicate that returns true if the first operand is "less" than the second operand.
Returns:
An iterator positioned at the minimum element in the container.

All Packages  Class Hierarchy  This Package  Previous  Next  Index