/** * Create list of arrays of items, in all possible permutations (that's n! permutations). * @return Iterator where each thing returned by the iterator is a permutation Object[] of * length size */ public Iterator<Object[]> generate(int size) { if(size > items.length) { throw new IllegalArgumentException("Size is larger than length"); //$NON-NLS-1$ } else if(size < 0) { throw new IllegalArgumentException("Size is negative"); //$NON-NLS-1$ } return new PermutationIterator(this.items, size); }
return getPermutation(j);
return getPermutation(j);
/** * Create list of arrays of items, in all possible permutations (that's n! permutations). * @return Iterator where each thing returned by the iterator is a permutation Object[] of * length size */ public Iterator<Object[]> generate(int size) { if(size > items.length) { throw new IllegalArgumentException("Size is larger than length"); //$NON-NLS-1$ } else if(size < 0) { throw new IllegalArgumentException("Size is negative"); //$NON-NLS-1$ } return new PermutationIterator(this.items, size); }
/** * Create list of arrays of items, in all possible permutations (that's n! permutations). * @return Iterator where each thing returned by the iterator is a permutation Object[] */ public Iterator<Object[]> generate() { return new PermutationIterator(this.items, this.items.length); }
/** * Create list of arrays of items, in all possible permutations (that's n! permutations). * @return Iterator where each thing returned by the iterator is a permutation Object[] */ public Iterator<Object[]> generate() { return new PermutationIterator(this.items, this.items.length); }
/** * Create list of arrays of items, in all possible permutations (that's n! permutations). * @return Iterator where each thing returned by the iterator is a permutation Object[] */ public Iterator<Object[]> generate() { return new PermutationIterator(this.items, this.items.length); }
/** * Create list of arrays of items, in all possible permutations (that's n! permutations). * @return Iterator where each thing returned by the iterator is a permutation Object[] of * length size */ public Iterator<Object[]> generate(int size) { if(size > items.length) { throw new IllegalArgumentException("Size is larger than length"); //$NON-NLS-1$ } else if(size < 0) { throw new IllegalArgumentException("Size is negative"); //$NON-NLS-1$ } return new PermutationIterator(this.items, size); }