/**
 *
 */
package org.jmist.packages;

import org.jmist.framework.IObserver;
import org.jmist.framework.ISpectralEstimator;

/**
 * A fixed-wavelengths observer.
 * @author bkimmel
 */
public final class FixedObserver implements IObserver {

	/**
	 * Initializes the wavelength to sample.
	 * @param wavelength The wavelength to sample (in meters).
	 */
	FixedObserver(double wavelength) {
		this.wavelengths = new double[]{ wavelength };
	}

	/**
	 * Initializes the wavelengths to sample.
	 * @param wavelengths The wavelengths to sample (in meters).
	 */
	FixedObserver(double[] wavelengths) {
		this.wavelengths = (double[]) wavelengths.clone();
	}

	/* (non-Javadoc)
	 * @see org.jmist.framework.IObserver#acquire(org.jmist.framework.ISpectralEstimator, double[])
	 */
	public void acquire(ISpectralEstimator estimator, double[] responses) {
		assert(responses.length == wavelengths.length);
		estimator.sample(wavelengths, responses);
	}

	/* (non-Javadoc)
	 * @see org.jmist.framework.IObserver#getNumberOfComponents()
	 */
	public int getNumberOfComponents() {
		return wavelengths.length;
	}

	/** The wavelengths to sample. */
	private final double[] wavelengths;

}

@@ -117,16 +117,48 @@
 timator;
+%0Aimport org.jmist.toolkit.Tuple;
 %0A%0A/**%0A *
@@ -445,18 +445,14 @@
 new 
-double%5B%5D%7B 
+Tuple(
 wave
@@ -461,10 +461,9 @@
 ngth
- %7D
+)
 ;%0A%09%7D
@@ -643,38 +643,219 @@
 s = 
-(double%5B%5D) wavelengths.clone()
+new Tuple(wavelengths);%0A%09%7D%0A%0A%09/**%0A%09 * Initializes the wavelengths to sample.%0A%09 * @param wavelengths The wavelengths to sample (in meters).%0A%09 */%0A%09FixedObserver(Tuple wavelengths) %7B%0A%09%09this.wavelengths = wavelengths
 ;%0A%09%7D
@@ -1090,22 +1090,22 @@
 lengths.
-length
+size()
 );%0A%09%09est
@@ -1292,22 +1292,22 @@
 lengths.
-length
+size()
 ;%0A%09%7D%0A%0A%09/
@@ -1354,24 +1354,21 @@
 e final 
-double%5B%5D
+Tuple
  wavelen

Update FixedObserver based on changes made to ISpectralEstimator.