All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.algorithms.Finding
java.lang.Object
|
+----COM.objectspace.jgl.algorithms.Finding
- public final class Finding
- extends Object
The Finding class contains generic Finding algorithms.
- See Also:
- FindingExamples
-
adjacentFind(Container)
- Find the first consecutive sequence of elements that match using equals().
-
adjacentFind(Container, BinaryPredicate)
- Find the first consecutive sequence of elements that match using a predicate.
-
adjacentFind(InputIterator, InputIterator)
- Find the first consecutive sequence of elements that match using equals().
-
adjacentFind(InputIterator, InputIterator, BinaryPredicate)
- Find the first consecutive sequence of elements that match using a predicate.
-
detect(Container, UnaryPredicate)
- Return the first object in a container that satisfies a specified predicate, or null
if no such object exists.
-
detect(ForwardIterator, ForwardIterator, UnaryPredicate)
- Return the first object in a range that satisfies a specified predicate, or null
if no such object exists.
-
every(Container, UnaryPredicate)
- Return true if every object in the container satisfies a particular predicate.
-
every(ForwardIterator, ForwardIterator, UnaryPredicate)
- Return true if every object in the specified range satisfies a particular predicate.
-
find(Container, Object)
- Find the first element in a container that matches a particular object using equals().
-
find(InputIterator, InputIterator, Object)
- Find the first element in a sequence that matches a particular object using equals().
-
findIf(Container, UnaryPredicate)
- Find the first element in a container that satisfies a predicate.
-
findIf(InputIterator, InputIterator, UnaryPredicate)
- Find the first element in a sequence that satisfies a predicate.
-
some(Container, UnaryPredicate)
- Return true if at least one object in the container satisfies the specified
unary predicate.
-
some(ForwardIterator, ForwardIterator, UnaryPredicate)
- Return true if at least one object in the given range satisfies the specified
unary predicate.
find
public static InputIterator find(InputIterator first,
InputIterator last,
Object object)
- Find the first element in a sequence that matches 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 of the sequence.
- last - An iterator positioned immediately after the last element of the sequence.
- object - The object to find.
- Returns:
- An iterator positioned at the first element that matches. If no match is
found, return an iterator positioned immediately after the last element of
the sequence.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
find
public static InputIterator find(Container container,
Object object)
- Find the first element in a container that matches a particular object using equals().
The time complexity is linear and the space complexity is constant.
- Parameters:
- container - The container.
- object - The object to find.
- Returns:
- An iterator positioned at the first element that matches. If no match is
found, return an iterator positioned immediately after the last element of
the container.
findIf
public static InputIterator findIf(InputIterator first,
InputIterator last,
UnaryPredicate predicate)
- Find the first element in a sequence that satisfies a predicate.
The time complexity is linear and the space complexity is constant.
- Parameters:
- first - An iterator positioned at the first element of the sequence.
- last - An iterator positioned immediately after the last element of the sequence.
- predicate - A unary predicate.
- Returns:
- An iterator positioned at the first element that matches. If no match is
found, return an iterator positioned immediately after the last element of
the sequence.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
findIf
public static InputIterator findIf(Container container,
UnaryPredicate predicate)
- Find the first element in a container that satisfies a predicate.
The time complexity is linear and the space complexity is constant.
- Parameters:
- container - The container.
- predicate - A unary predicate.
- Returns:
- An iterator positioned at the first element that matches. If no match is
found, return an iterator positioned immediately after the last element of
the sequence.
adjacentFind
public static InputIterator adjacentFind(InputIterator first,
InputIterator last)
- Find the first consecutive sequence of elements that match using equals().
The time complexity is linear and the space complexity is constant.
- Parameters:
- first - An iterator positioned at the first element of the sequence.
- last - An iterator positioned immediately after the last element of the sequence.
- Returns:
- An iterator positioned at the first element in the consecutive sequence. If
no consecutive sequence is found, return an iterator positioned immediately after
the last element of the input sequence.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
adjacentFind
public static InputIterator adjacentFind(Container container)
- Find the first consecutive sequence of elements that match using equals().
The time complexity is linear and the space complexity is constant.
- Parameters:
- container - The container to search.
- Returns:
- An iterator positioned at the first element in the consecutive sequence. If
no consecutive sequence is found, return an iterator positioned immediately after
the last element of the container.
adjacentFind
public static InputIterator adjacentFind(InputIterator first,
InputIterator last,
BinaryPredicate predicate)
- Find the first consecutive sequence of elements that match using a predicate.
The time complexity is linear and the space complexity is constant.
- Parameters:
- first - An iterator positioned at the first element of the sequence.
- last - An iterator positioned immediately after the last element of the sequence.
- predicate - A binary predicate.
- Returns:
- An iterator positioned at the first element in the consecutive sequence. If
no consecutive sequence is found, return an iterator positioned immediately after
the last element of the input sequence.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
adjacentFind
public static InputIterator adjacentFind(Container container,
BinaryPredicate predicate)
- Find the first consecutive sequence of elements that match using a predicate.
The time complexity is linear and the space complexity is constant.
- Parameters:
- container - The container to search.
- predicate - A binary predicate.
- Returns:
- An iterator positioned at the first element in the consecutive sequence. If
no consecutive sequence is found, return an iterator positioned immediately after
the last element of the container.
detect
public static Object detect(ForwardIterator first,
ForwardIterator last,
UnaryPredicate predicate)
- Return the first object in a range that satisfies a specified predicate, or null
if no such object exists.
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 first object that causes the predicate to return true.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
detect
public static Object detect(Container container,
UnaryPredicate predicate)
- Return the first object in a container that satisfies a specified predicate, or null
if no such object exists.
The time complexity is linear and the space complexity is constant.
- Parameters:
- container - The container to search.
- predicate - A unary predicate.
- Returns:
- The first object that causes the predicate to return true.
- Throws: IllegalArgumentException
- If the iterator containers are different.
some
public static boolean some(ForwardIterator first,
ForwardIterator last,
UnaryPredicate predicate)
- Return true if at least one object in the given range satisfies the specified
unary 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:
- true if at least one object satisfies the predicate.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
some
public static boolean some(Container container,
UnaryPredicate predicate)
- Return true if at least one object in the container satisfies the specified
unary predicate. The time complexity is linear and the space complexity is constant.
- Parameters:
- container - A container to search
- predicate - A unary predicate.
- Returns:
- true if at least one object satisfies the predicate.
every
public static boolean every(ForwardIterator first,
ForwardIterator last,
UnaryPredicate predicate)
- Return true if every object in the specified range satisfies a particular 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:
- true if all objects satisfy the predicate.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
every
public static boolean every(Container container,
UnaryPredicate predicate)
- Return true if every object in the container satisfies a particular predicate.
The time complexity is linear and the space complexity is constant.
- Parameters:
- container - A container to search
- predicate - A unary predicate.
- Returns:
- true if all objects satisfy the predicate.
All Packages Class Hierarchy This Package Previous Next Index