All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.MinMax
java.lang.Object
|
+----COM.objectspace.jgl.MinMax
- public final class MinMax
- extends Object
The MinMax class contains generic min/max algorithms.
- See Also:
- MinMaxExamples
-
maxElement(Container)
- Find the maximum element in a container.
-
maxElement(Container, BinaryPredicate)
- Find the maximum element in a container.
-
maxElement(InputIterator, InputIterator)
- Find the maximum element in a sequence.
-
maxElement(InputIterator, InputIterator, BinaryPredicate)
- Find the maximum element in a sequence.
-
minElement(Container)
- Find the minimum element in a container.
-
minElement(Container, BinaryPredicate)
- Find the minimum element in a container.
-
minElement(InputIterator, InputIterator)
- Find the minimum element in a sequence.
-
minElement(InputIterator, InputIterator, BinaryPredicate)
- Find the minimum element in a sequence.
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.
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.
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.
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.
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.
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.
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.
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