org.geolatte.geom.generator.CombinedGeometryGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geolatte-geom Show documentation
Show all versions of geolatte-geom Show documentation
This geoLatte-geom library offers a geometry model that conforms to the OGC Simple Features for SQL
specification.
The newest version!
package org.geolatte.geom.generator;
import org.geolatte.geom.Geometry;
import org.geolatte.geom.Position;
import java.util.List;
import java.util.Random;
/**
* Created by Karel Maesen, Geovise BVBA on 28/09/2018.
*/
class CombinedGeometryGenerator implements Generator> {
private final Random chooser;
private final List>> generators;
CombinedGeometryGenerator(Random rnd, List>> generators) {
this.chooser = rnd;
this.generators = generators;
}
@Override
public Geometry generate() {
int idx = chooser.nextInt(generators.size());
return generators.get(idx).generate();
}
}