Class jgl.Counting
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jgl.Counting

java.lang.Object
   |
   +----jgl.Counting

public final class Counting
extends Object
The Counting class contains generic counting algorithms.

See Also:
CountingExamples

Method Index

 o count(Container, Object)
Return the number of elements in a container that match a particular object using equals().
 o count(InputIterator, InputIterator, Object)
Return the number of elements in a range that match a particular object using equals().
 o countIf(Container, UnaryPredicate)
Return the number of elements in a container that satisfy a predicate.
 o countIf(InputIterator, InputIterator, UnaryPredicate)
Return the number of elements in a range that satisfy a predicate.

Methods

 o count
  public static int count(InputIterator first,
                          InputIterator last,
                          Object object)
Return the number of elements in a range that match a particular object using equals(). The time complexity is linear and the space complexity is constant.
Parameters:
first - An iterator positioned at the first element in the range.
last - An iterator positioned immediately after the last element in the range.
object - The object to count.
Returns:
The number of objects that matched.
 o count
  public static int count(Container container,
                          Object object)
Return the number of elements in a container that match a particular object using equals(). The time complexity is linear and the space complexity is constant.
Parameters:
container - The container.
object - The object to count.
Returns:
The number of objects that matched.
 o countIf
  public static int countIf(InputIterator first,
                            InputIterator last,
                            UnaryPredicate predicate)
Return the number of elements in a range that satisfy a predicate. The time complexity is linear and the space complexity is constant.
Parameters:
first - An iterator positioned at the first element in the range.
last - An iterator positioned immediately after the last element in the range.
predicate - A unary predicate.
Returns:
The number of objects that matched.
 o countIf
  public static int countIf(Container container,
                            UnaryPredicate predicate)
Return the number of elements in a container that satisfy a predicate. The time complexity is linear and the space complexity is constant.
Parameters:
first - An iterator positioned at the first element in the range.
last - An iterator positioned immediately after the last element in the range.
predicate - A unary predicate.
Returns:
The number of objects that matched.

All Packages  Class Hierarchy  This Package  Previous  Next  Index