public void addSample(String sampleReference,
			Distribution sampleDistribution, int sampleSize) {
		if ((sampleSize > 0) && (sampleDistribution != null)) {
			// if the sample is already contained in the list, we need to
			// remove it first and subtract its size from the sum of sizes prior
			// to replacing it.
			if (this.sampleSizes.containsKey(sampleReference)) {
				int oldsize = this.sampleSizes.get(sampleReference);
				this.sampleSizes.remove(sampleReference);
				this.sampleDistributions.remove(sampleReference);
				this.sampleSizeSum -= oldsize;
				if (this.largestSample.equals(sampleReference)
						&& (oldsize > sampleSize)) {
					// the largest sample is replaced by a smaller sample. So we
					// have to search for a newest largest sample among all
					// others
					String currentLargest = null;
					int currentsize = 0;
					for (String sample : this.getSampleReferences()) {
						int size = this.getSampleSize(sample);
						if (size > currentsize) {
							currentLargest = sample;
						}
					}
					this.largestSample = currentLargest;
				}
			}
			// update reference to largest sample if necessary
			if ((this.largestSample == null)
					|| (this.getSampleSize(this.largestSample) < sampleSize)) {
				this.largestSample = sampleReference;
			}
			this.sampleDistributions.put(sampleReference, sampleDistribution);
			this.sampleSizes.put(sampleReference, sampleSize);
			this.sampleSizeSum += sampleSize;
		} else {
			throw new IllegalArgumentException("Sample size must be positive");
		}
	}