View SampleSet.java
/** A container that collects a set of data samples and provides statistical measures on them.
* <P>
* The general contract is that the methods shall not return any other value than 0
* in case no samples' have been inserted into the set.
* Implementing classes may choose to throw IllegalStateException in such an illegal use case.
* <P>
* Implementing classes are not generally required to be thread-safe.
*/
public interface SampleSet {
/** Puts a sample into this bucket sample counter.
View TrajectoryCalculator.java
/**
* Authored 2012 by Christer Swahn
*/
import nu.chervil.util.math.SpatialTuple;
import nu.chervil.util.math.SpatialVector;
import org.apache.log4j.Logger;
/**
View generateRandomString.java
/** Returns a newly created string consisting of the specified number of random
* alphanumeric characters. */
public static String generateRandomString(int length) {
final char[] KEYCHARS = "0123456789abcdefghijklmnopqrstuvwxyz".toCharArray();
Random randomizer = new Random();
char[] randomString = new char[length];
for (int i = 0; i < length; i++) {
randomString[i] = KEYCHARS[randomizer.nextInt(KEYCHARS.length)];
}
return new String(randomString);