All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.algorithms.Filtering
java.lang.Object
|
+----COM.objectspace.jgl.algorithms.Filtering
- public final class Filtering
- extends Object
The Filtering class contains generic filtering algorithms.
- See Also:
- FilteringExamples
-
reject(Container, UnaryPredicate)
- Reject elements in a container.
-
reject(InputIterator, InputIterator, UnaryPredicate)
- Reject elements in a range.
-
select(Container, UnaryPredicate)
- Select elements in a container.
-
select(InputIterator, InputIterator, UnaryPredicate)
- Select elements in a range.
-
unique(Container)
- Replace all consecutive occurrences of an object in a container by a single
instance of that object.
-
unique(Container, BinaryPredicate)
- Replace all consecutive occurrences of an object in a container by a single
instance of that object.
-
unique(ForwardIterator, ForwardIterator)
- Replace all consecutive occurrences of an object in a sequence by a single
instance of that object.
-
unique(ForwardIterator, ForwardIterator, BinaryPredicate)
- Replace all consecutive occurrences of an object in a sequence by a single
instance of that object.
-
uniqueCopy(Container, Container)
- Copy the contents of one container into another container, replacing all consecutive
occurrences of an object by a single instance of that object.
-
uniqueCopy(Container, Container, BinaryPredicate)
- Copy the contents of one container into another container, replacing all consecutive
occurrences of an object by a single instance of that object.
-
uniqueCopy(Container, OutputIterator)
- Copy a container into another sequence, replacing all consecutive occurrences of an
object by a single instance of that object.
-
uniqueCopy(Container, OutputIterator, BinaryPredicate)
- Copy a container into another sequence, replacing all consecutive occurrences of an
object by a single instance of that object.
-
uniqueCopy(InputIterator, InputIterator, OutputIterator)
- Copy a sequence into another sequence, replacing all consecutive occurrences of an
object by a single instance of that object.
-
uniqueCopy(InputIterator, InputIterator, OutputIterator, BinaryPredicate)
- Copy a sequence into another sequence, replacing all consecutive occurrences of an
object by a single instance of that object.
unique
public static OutputIterator unique(ForwardIterator first,
ForwardIterator last)
- Replace all consecutive occurrences of an object in a sequence by a single
instance of that object. Use equals() to perform the equality test. The size of the
sequence is not altered; if n elements are removed, the last n elements will have
undefined values. 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 immediately after the last element of the "new" sequence.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
unique
public static OutputIterator unique(Container container)
- Replace all consecutive occurrences of an object in a container by a single
instance of that object. Use equals() to perform the equality test. The size of the
container is not altered; if n elements are removed, the last n elements will have
undefined values. The time complexity is linear and the space complexity is constant.
- Parameters:
- container - The container.
- Returns:
- An iterator positioned immediately after the last element of the "new" sequence.
unique
public static OutputIterator unique(ForwardIterator first,
ForwardIterator last,
BinaryPredicate predicate)
- Replace all consecutive occurrences of an object in a sequence by a single
instance of that object. The size of the sequence is not altered; if n elements are
removed, the last n elements will have undefined values. 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 that returns true if both of its operands are "equal".
- Returns:
- An iterator positioned immediately after the last element of the new sequence.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
unique
public static OutputIterator unique(Container container,
BinaryPredicate predicate)
- Replace all consecutive occurrences of an object in a container by a single
instance of that object. The size of the container is not altered; if n elements are
removed, the last n elements will have undefined values. The time complexity is
linear and the space complexity is constant.
- Parameters:
- container - The container.
- predicate - A binary predicate that returns true if both of its operands are "equal".
- Returns:
- An iterator positioned immediately after the last element of the "new" sequence.
uniqueCopy
public static OutputIterator uniqueCopy(InputIterator first,
InputIterator last,
OutputIterator result)
- Copy a sequence into another sequence, replacing all consecutive occurrences of an
object by a single instance of that object. Use equals() to perform the equality test.
The time complexity is linear and the space complexity is constant.
- Parameters:
- first - An iterator positioned at the first element of the input sequence.
- last - An iterator positioned immediately after the last element of the input sequence.
- result - An iterator positioned at the first element of the output sequence.
- Returns:
- An iterator positioned immediately after the last element of the output sequence.
uniqueCopy
public static OutputIterator uniqueCopy(Container container,
OutputIterator result)
- Copy a container into another sequence, replacing all consecutive occurrences of an
object by a single instance of that object. Use equals() to perform the equality test.
The time complexity is linear and the space complexity is constant.
- Parameters:
- container - The container.
- result - An iterator positioned at the first element of the output sequence.
- Returns:
- An iterator positioned immediately after the last element of the output sequence.
uniqueCopy
public static void uniqueCopy(Container source,
Container destination)
- Copy the contents of one container into another container, replacing all consecutive
occurrences of an object by a single instance of that object. Use equals() to perform
the equality test. The time complexity is linear and the space complexity is constant.
- Parameters:
- source - The source container.
- destination - The destination container.
uniqueCopy
public static OutputIterator uniqueCopy(InputIterator first,
InputIterator last,
OutputIterator result,
BinaryPredicate predicate)
- Copy a sequence into another sequence, replacing all consecutive occurrences of an
object by a single instance of that object. The time complexity is linear and the
space complexity is constant.
- Parameters:
- first - An iterator positioned at the first element of the input sequence.
- last - An iterator positioned immediately after the last element of the input sequence.
- result - An iterator positioned at the first element of the output sequence.
- predicate - A binary predicate that returns true if both of its operands are "equal".
- Returns:
- An iterator positioned immediately after the last element of the output sequence.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
uniqueCopy
public static OutputIterator uniqueCopy(Container container,
OutputIterator result,
BinaryPredicate predicate)
- Copy a container into another sequence, replacing all consecutive occurrences of an
object by a single instance of that object. The time complexity is linear and the
space complexity is constant.
- Parameters:
- container - A container.
- result - An iterator positioned at the first element of the output sequence.
- predicate - A binary predicate that returns true if both of its operands are "equal".
- Returns:
- An iterator positioned immediately after the last element of the output sequence.
uniqueCopy
public static void uniqueCopy(Container source,
Container destination,
BinaryPredicate predicate)
- Copy the contents of one container into another container, replacing all consecutive
occurrences of an object by a single instance of that object. The time complexity is
linear and the space complexity is constant.
- Parameters:
- source - The source container.
- destination - The destination container.
- predicate - A binary predicate that returns true if both of its operands are "equal".
select
public static Container select(InputIterator first,
InputIterator last,
UnaryPredicate predicate)
- Select elements in a range. Return a container that is the same type
as that bein iterated over and only contains the elements within the range that satisfy
a particular predicate. The original container is not modified.
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:
- A new container containing the elements that satisfied the predicate.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
select
public static Container select(Container container,
UnaryPredicate predicate)
- Select elements in a container. Return a container that is the same class as
the original and only contains the elements that satisfy a particular predicate.
The original container is not modified.
The time complexity is linear and the space complexity is constant.
- Parameters:
- container - A container.
- predicate - A unary predicate.
- Returns:
- A new container containing the elements that satisfied the predicate.
reject
public static Container reject(InputIterator first,
InputIterator last,
UnaryPredicate predicate)
- Reject elements in a range. Return a container that is the same class as the
original and only contains the elements within the range that do not satisfy a
particular predicate. The original container is not modified.
The time complexity is linear and the space complexity is constant.
- Parameters:
- first - An iterator positioned at the first element of the range.
- last - An iterator positioned immediately after the last element of the range.
- predicate - A unary predicate.
- Returns:
- A new container containing the elements that do not satisfy the predicate.
- Throws: IllegalArgumentException
- If the iterator container types are different.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
reject
public static Container reject(Container container,
UnaryPredicate predicate)
- Reject elements in a container. Return a container that is the same class as
the original and only contains the elements that do not satisfy a particular predicate.
The original container is not modified.
The time complexity is linear and the space complexity is constant.
- Parameters:
- container - A container
- predicate - A unary predicate.
- Returns:
- A new container containing the elements that do not satisfy the predicate.
All Packages Class Hierarchy This Package Previous Next Index