All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cfg.AndGenerator Maven / Gradle / Ivy

The newest version!
package cfg;

import java.util.ArrayList;

public class AndGenerator implements Generator {
    ArrayList generators = new ArrayList();
    public AndGenerator(ArrayList _generators) {
	generators=_generators;
    }
    public void add(Generator generator) {
	generators.add(generator);
    }

    @Override public String generate() {
	StringBuilder sb = new StringBuilder();
	for (Generator generator : generators) {
	    sb.append(generator.generate());
	}
	return sb.toString();
    }	

    @Override public String toString() {
	StringBuilder sb = new StringBuilder();
	for (Generator generator : generators) {
	    if (sb.length() > 0) { sb.append("&"); }
	    sb.append(generator.toString());
	}
	return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy