All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.Filtering

java.lang.Object
   |
   +----COM.objectspace.jgl.Filtering

public final class Filtering
extends Object
The Filtering class contains generic filtering algorithms.

Version:
2.0.2
Author:
ObjectSpace, Inc.
See Also:
FilteringExamples

Method Index

 o reject(Container, UnaryPredicate)
Reject elements in a container.
 o reject(ForwardIterator, ForwardIterator, UnaryPredicate)
Reject elements in a range.
 o select(Container, UnaryPredicate)
Select elements in a container.
 o select(ForwardIterator, ForwardIterator, UnaryPredicate)
Select elements in a range.
 o unique(Container)
Replace all consecutive occurrences of an object in a container by a single instance of that object.
 o unique(Container, BinaryPredicate)
Replace all consecutive occurrences of an object in a container by a single instance of that object.
 o unique(ForwardIterator, ForwardIterator)
Replace all consecutive occurrences of an object in a sequence by a single instance of that object.
 o unique(ForwardIterator, ForwardIterator, BinaryPredicate)
Replace all consecutive occurrences of an object in a sequence by a single instance of that object.
 o 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.
 o 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.
 o uniqueCopy(Container, OutputIterator)
Copy a container into another sequence, replacing all consecutive occurrences of an object by a single instance of that object.
 o uniqueCopy(Container, OutputIterator, BinaryPredicate)
Copy a container into another sequence, replacing all consecutive occurrences of an object by a single instance of that object.
 o uniqueCopy(InputIterator, InputIterator, OutputIterator)
Copy a sequence into another sequence, replacing all consecutive occurrences of an object by a single instance of that object.
 o 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.

Methods

 o unique
 public static ForwardIterator 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.
 o unique
 public static ForwardIterator 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.
 o unique
 public static ForwardIterator 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.
 o unique
 public static ForwardIterator 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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".
 o select
 public static Container select(ForwardIterator first,
                                ForwardIterator last,
                                UnaryPredicate predicate)
Select elements in a range. Return a container that is the same class as the original 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 iterator container types are different.
 o 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.
 o reject
 public static Container reject(ForwardIterator first,
                                ForwardIterator 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.
 o 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