Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2010 the original author or authors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.callbackparams.combine;
CombineStrategy that creates all callback-records possible. The number of records will grow exponentially with each array of callback-records added to ValuesCollection and that might result in an utterly high number of callback-records that might surprise an inexperienced developer. Therefore this strategy will come with a default maxCount of 100, which must be increased if the developer intends to use this strategy to produce a larger number of callback-records.

Henrik Kaipe
public class CombineCompletely extends AbstractCombineStrategy {
    public CombineCompletely() {
        this. = 100;
    protected Collection combineInternal(final ValuesCollection vc) {
         * The size can be pre-calculated - which is good since it can end up
         * being pretty large.
        long size = 1; // Need to use long to prevent possible overflow
        for (int i = 0, length = vc.size() ;  i < length ; ++i) {
            size *= vc.get(i).length;
            if (. < size) {
                size = .;
        final int intSize = (intsize;
        return new AbstractCollection() {
            public Iterator iterator() {
                return CompleteCombinator.combine(vc);
            public int size() {
                return intSize;
New to GrepCode? Check out our FAQ X