public class

Tuples

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.base.Tuples

Class Overview

Integer tuples generator routines.

Summary

Public Constructors
Tuples()
Public Methods
static List<List<Integer>> generateIntegerTuples(int n)
Generate all tuples containing the numbers 0 to n-1.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Tuples ()

Public Methods

public static List<List<Integer>> generateIntegerTuples (int n)

Generate all tuples containing the numbers 0 to n-1. Be careful, n! tuples will be generated.

For instance, for n=3, the tuples are:

 (0,1,2), (0,2,1), (1,0,2), (1,2,0), (2,0,1), (2,1,0)
 

Parameters
n the tuple size
Returns
  • the list of tuples, or null is n<=0