org.biojava.bio.structure.quaternary
Class CartesianProduct<T>

java.lang.Object
  extended by org.biojava.bio.structure.quaternary.CartesianProduct<T>

public class CartesianProduct<T>
extends java.lang.Object

A cartesian product between two lists A and B is the set of all ordered pairs of the elements of both sets. See http://en.wikipedia.org/wiki/Cartesian_product for more details. Since the order of the elements matters; Lists are used instead of Sets. Example: A = {1, 2, 3} B = {4, 5} The ordered pairs are {1, 4}, {1, 5}, {2, 4}, .., {3, 5}

Author:
Peter Rose

Constructor Summary
CartesianProduct(java.util.List<T> list1, java.util.List<T> list2)
          Class constructor specifying the two lists of a cartesian product.
 
Method Summary
 java.util.List<OrderedPair<T>> getOrderedPairs()
          Generates the list of ordered pair between two sets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CartesianProduct

public CartesianProduct(java.util.List<T> list1,
                        java.util.List<T> list2)
Class constructor specifying the two lists of a cartesian product.

Method Detail

getOrderedPairs

public java.util.List<OrderedPair<T>> getOrderedPairs()
Generates the list of ordered pair between two sets.

Returns:
the list of ordered pairs