All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.algorithms.OrderedSetOperations

java.lang.Object
   |
   +----COM.objectspace.jgl.algorithms.OrderedSetOperations

public final class OrderedSetOperations
extends Object
The OrderedSetOperations class contains generic set operation algorithms.

See Also:
OrderedSetOperationsExamples

Method Index

 o includes(Container, Container, BinaryPredicate)
Return true if every element in the second container is also in the first.
 o includes(InputIterator, InputIterator, InputIterator, InputIterator)
Return true if every element in the first sequence is also in the second.
 o includes(InputIterator, InputIterator, InputIterator, InputIterator, BinaryPredicate)
Return true if every element in the second sequence is also in the first.
 o setDifference(Container, Container, OutputIterator, BinaryPredicate)
Place the sorted difference of two containers into a sequence.
 o setDifference(InputIterator, InputIterator, InputIterator, InputIterator, OutputIterator)
Place the sorted difference of two sequences into another sequence.
 o setDifference(InputIterator, InputIterator, InputIterator, InputIterator, OutputIterator, BinaryPredicate)
Place the sorted difference of two sequences into another sequence.
 o setIntersection(Container, Container, OutputIterator, BinaryPredicate)
Place the sorted intersection of two containers into a sequence.
 o setIntersection(InputIterator, InputIterator, InputIterator, InputIterator, OutputIterator)
Place the sorted intersection of two sequences into another sequence.
 o setIntersection(InputIterator, InputIterator, InputIterator, InputIterator, OutputIterator, BinaryPredicate)
Place the sorted intersection of two sequences into another sequence.
 o setSymmetricDifference(Container, Container, OutputIterator, BinaryPredicate)
Place the sorted symmetric difference of two containers into a sequence.
 o setSymmetricDifference(InputIterator, InputIterator, InputIterator, InputIterator, OutputIterator)
Place the sorted symmetric difference of two sequences into another sequence.
 o setSymmetricDifference(InputIterator, InputIterator, InputIterator, InputIterator, OutputIterator, BinaryPredicate)
Place the sorted symmetric difference of two sequences into another sequence.
 o setUnion(Container, Container, OutputIterator, BinaryPredicate)
Place the sorted union of two containers into a sequence.
 o setUnion(InputIterator, InputIterator, InputIterator, InputIterator, OutputIterator)
Place the sorted union of two sequences into another sequence.
 o setUnion(InputIterator, InputIterator, InputIterator, InputIterator, OutputIterator, BinaryPredicate)
Place the sorted union of two sequences into another sequence.

Methods

 o includes
 public static boolean includes(InputIterator first1,
                                InputIterator last1,
                                InputIterator first2,
                                InputIterator last2)
Return true if every element in the first sequence is also in the second. It assumed that both sequences were sorted prior to this operation according to their hash code. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first sequence.
last1 - An iterator positioned immediately after the last element of the first sequence.
first2 - An iterator positioned at the first element of the second sequence.
last2 - An iterator positioned immediately after the last element of the second sequence.
Returns:
True if every element in the first sequence is also in the second.
 o includes
 public static boolean includes(InputIterator first1,
                                InputIterator last1,
                                InputIterator first2,
                                InputIterator last2,
                                BinaryPredicate comparator)
Return true if every element in the second sequence is also in the first. It assumed that both sequences were sorted prior to this operation according to the specified comparator. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first sequence.
last1 - An iterator positioned immediately after the last element of the first sequence.
first2 - An iterator positioned at the first element of the second sequence.
last2 - An iterator positioned immediately after the last element of the second sequence.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
True if every element in the second sequence is also in the first.
 o includes
 public static boolean includes(Container container1,
                                Container container2,
                                BinaryPredicate comparator)
Return true if every element in the second container is also in the first. It assumed that both containers were sorted prior to this operation according to the specified comparator. The time complexity is linear and the space complexity is constant.

Parameters:
container1 - The first container.
container2 - The second container.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
True if every element in the second container is also in the first.
 o setUnion
 public static OutputIterator setUnion(InputIterator first1,
                                       InputIterator last1,
                                       InputIterator first2,
                                       InputIterator last2,
                                       OutputIterator result)
Place the sorted union of two sequences into another sequence. It assumed that both sequences were sorted prior to this operation according to their hash code. The result is undefined if the two input sequences overlap. If an element occurs in both sequences, the element from the first sequence is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first input sequence.
last1 - An iterator positioned immediately after the last element of the first input sequence.
first2 - An iterator positioned at the first element of the second input sequence.
last2 - An iterator positioned immediately after the last element of the second 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 setUnion
 public static OutputIterator setUnion(InputIterator first1,
                                       InputIterator last1,
                                       InputIterator first2,
                                       InputIterator last2,
                                       OutputIterator result,
                                       BinaryPredicate comparator)
Place the sorted union of two sequences into another sequence. It assumed that both sequences were sorted prior to this operation according to the specified comparator. The result is undefined if the two input sequences overlap. If an element occurs in both sequences, the element from the first sequence is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first input sequence.
last1 - An iterator positioned immediately after the last element of the first input sequence.
first2 - An iterator positioned at the first element of the second input sequence.
last2 - An iterator positioned immediately after the last element of the second input sequence.
result - An iterator positioned at the first element of the output sequence.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o setUnion
 public static OutputIterator setUnion(Container container1,
                                       Container container2,
                                       OutputIterator result,
                                       BinaryPredicate comparator)
Place the sorted union of two containers into a sequence. It assumed that both containers were sorted prior to this operation according to the specified comparator. If an element occurs in both containers, the element from the first container is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
container1 - The first container.
container2 - The second container.
result - An iterator positioned at the first element of the output sequence.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o setIntersection
 public static OutputIterator setIntersection(InputIterator first1,
                                              InputIterator last1,
                                              InputIterator first2,
                                              InputIterator last2,
                                              OutputIterator result)
Place the sorted intersection of two sequences into another sequence. It assumed that both sequences were sorted prior to this operation according to their hash code. The result is undefined if the two input sequences overlap. If an element occurs in both sequences, the element from the first sequence is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first input sequence.
last1 - An iterator positioned immediately after the last element of the first input sequence.
first2 - An iterator positioned at the first element of the second input sequence.
last2 - An iterator positioned immediately after the last element of the second 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 setIntersection
 public static OutputIterator setIntersection(InputIterator first1,
                                              InputIterator last1,
                                              InputIterator first2,
                                              InputIterator last2,
                                              OutputIterator result,
                                              BinaryPredicate comparator)
Place the sorted intersection of two sequences into another sequence. It assumed that both sequences were sorted prior to this operation according to the specified comparator. The result is undefined if the two input sequences overlap. If an element occurs in both sequences, the element from the first sequence is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first input sequence.
last1 - An iterator positioned immediately after the last element of the first input sequence.
first2 - An iterator positioned at the first element of the second input sequence.
last2 - An iterator positioned immediately after the last element of the second input sequence.
result - An iterator positioned at the first element of the output sequence.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o setIntersection
 public static OutputIterator setIntersection(Container container1,
                                              Container container2,
                                              OutputIterator result,
                                              BinaryPredicate comparator)
Place the sorted intersection of two containers into a sequence. It assumed that both containers were sorted prior to this operation according to the specified comparator. If an element occurs in both containers, the element from the first container is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
container1 - The first container.
container2 - The second container.
result - An iterator positioned at the first element of the output sequence.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o setDifference
 public static OutputIterator setDifference(InputIterator first1,
                                            InputIterator last1,
                                            InputIterator first2,
                                            InputIterator last2,
                                            OutputIterator result)
Place the sorted difference of two sequences into another sequence. The output sequence will contain all elements that are in the first sequence but not in the second sequence. It assumed that both sequences were sorted prior to this operation according to their hash code. The result is undefined if the two input sequences overlap. If an element occurs in both sequences, the element from the first sequence is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first input sequence.
last1 - An iterator positioned immediately after the last element of the first input sequence.
first2 - An iterator positioned at the first element of the second input sequence.
last2 - An iterator positioned immediately after the last element of the second 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 setDifference
 public static OutputIterator setDifference(InputIterator first1,
                                            InputIterator last1,
                                            InputIterator first2,
                                            InputIterator last2,
                                            OutputIterator result,
                                            BinaryPredicate comparator)
Place the sorted difference of two sequences into another sequence. The output sequence will contain all elements that are in the first sequence but not in the second sequence. It assumed that both sequences were sorted prior to this operation according to the specified comparator. The result is undefined if the two input sequences overlap. If an element occurs in both sequences, the element from the first sequence is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first input sequence.
last1 - An iterator positioned immediately after the last element of the first input sequence.
first2 - An iterator positioned at the first element of the second input sequence.
last2 - An iterator positioned immediately after the last element of the second input sequence.
result - An iterator positioned at the first element of the output sequence.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o setDifference
 public static OutputIterator setDifference(Container container1,
                                            Container container2,
                                            OutputIterator result,
                                            BinaryPredicate comparator)
Place the sorted difference of two containers into a sequence. The output sequence will contain all elements that are in the first container but not in the second container. It assumed that both containers were sorted prior to this operation according to the specified comparator. If an element occurs in both containers, the element from the first container is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
container1 - The first container.
container2 - The second container.
result - An iterator positioned at the first element of the output sequence.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o setSymmetricDifference
 public static OutputIterator setSymmetricDifference(InputIterator first1,
                                                     InputIterator last1,
                                                     InputIterator first2,
                                                     InputIterator last2,
                                                     OutputIterator result)
Place the sorted symmetric difference of two sequences into another sequence. The output sequence will contain all elements that are in one sequence but not in the other. It assumed that both sequences were sorted prior to this operation according to their hash code. The result is undefined if the two input sequences overlap. If an element occurs in both sequences, the element from the first sequence is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first input sequence.
last1 - An iterator positioned immediately after the last element of the first input sequence.
first2 - An iterator positioned at the first element of the second input sequence.
last2 - An iterator positioned immediately after the last element of the second 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 setSymmetricDifference
 public static OutputIterator setSymmetricDifference(InputIterator first1,
                                                     InputIterator last1,
                                                     InputIterator first2,
                                                     InputIterator last2,
                                                     OutputIterator result,
                                                     BinaryPredicate comparator)
Place the sorted symmetric difference of two sequences into another sequence. The output sequence will contain all elements that are in one sequence but not in the other. It assumed that both sequences were sorted prior to this operation according to the specified comparator. The result is undefined if the two input sequences overlap. If an element occurs in both sequences, the element from the first sequence is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first1 - An iterator positioned at the first element of the first input sequence.
last1 - An iterator positioned immediately after the last element of the first input sequence.
first2 - An iterator positioned at the first element of the second input sequence.
last2 - An iterator positioned immediately after the last element of the second input sequence.
result - An iterator positioned at the first element of the output sequence.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o setSymmetricDifference
 public static OutputIterator setSymmetricDifference(Container container1,
                                                     Container container2,
                                                     OutputIterator result,
                                                     BinaryPredicate comparator)
Place the sorted symmetric difference of two containers into a sequence. The output sequence will contain all elements that are in one container but not in the other. It assumed that both containers were sorted prior to this operation according to the specified comparator. If an element occurs in both containers, the element from the first container is copied into the result sequence. The time complexity is linear and the space complexity is constant.

Parameters:
container1 - The first container.
container2 - The second container.
result - An iterator positioned at the first element of the output sequence.
comparator - A BinaryPredicate that returns true if its first operand is "less" than its second operand.
Returns:
An iterator positioned immediately after the last element of the output sequence.

All Packages  Class Hierarchy  This Package  Previous  Next  Index