// Path: src/java/org/sidoh/song_recognition/signature/ConstellationMap.java
// public static class Star implements Serializable {
// 	private static final long serialVersionUID = 1851275921474044916L;
// 		
// 
// 	private final double time;
// 	private final double frequency;
// 	private final double intensity;
// 	private final int x;
// 	private final int y;
// 		
// 	public Star(final double time, final double frequency, final double intensity, final int x, final int y) {
// 		this.time = time;
// 		this.frequency = frequency;
// 		this.intensity = intensity;
// 		this.x = x;
// 		this.y = y;
// 	}
// 
// 	public double getTime() {
// 		return time;
// 	}
// 
// 	public double getFrequency() {
// 		return frequency;
// 	}
// 
// 	public double getIntensity() {
// 		return intensity;
// 	}
// 		
// 	public int getTick() {
// 		return x;
// 	}
// 		
// 	public int getBin() {
// 		return y;
// 	}
// 		
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + x;
// 		result = prime * result + y;
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		Star other = (Star) obj;
// 		if (x != other.x)
// 			return false;
// 		if (y != other.y)
// 			return false;
// 		return true;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Star [x=" + x + ", y=" + y + ", intensity=" + intensity + "]";
// 	}
// }


import java.util.Iterator;
import org.sidoh.song_recognition.signature.ConstellationMap.Star;
import org.sidoh.song_recognition.spectrogram.Spectrogram;
	protected final Spectrogram spec;

	public StarBuffer(Spectrogram spec) {
		this.spec = spec;
	}

	/**
	 * Offer a {@link Star} to this buffer. It may or may not accept it, and this 
	 * {@link Star} may or may not be returned by {@link #flush()} depending on
	 * how the internal logic works.
	 * 
	 * @param s
	 */
	public abstract void offerStar(Star s);
	
	/**
	 * Returns a list of stars it'd like to keep.
	 * 
	 * @return
	 */
	public abstract Iterable<Star> flush();
	
	public static StarBuffer.Builder coordinateAgnostic(double starDensityFactor) {
		return new CoordinateAgnosticStarBuffer.Builder(starDensityFactor);
	}
	
	public static StarBuffer.Builder evenlySpreadInTime(double starDensityFactor) {
		return new EvenlySpreadInTimeStarBuffer.Builder(starDensityFactor);
	}
	
// Path: src/java/org/sidoh/song_recognition/signature/ConstellationMap.java
// public static class Star implements Serializable {
// 	private static final long serialVersionUID = 1851275921474044916L;
// 		
// 
// 	private final double time;
// 	private final double frequency;
// 	private final double intensity;
// 	private final int x;
// 	private final int y;
// 		
// 	public Star(final double time, final double frequency, final double intensity, final int x, final int y) {
// 		this.time = time;
// 		this.frequency = frequency;
// 		this.intensity = intensity;
// 		this.x = x;
// 		this.y = y;
// 	}
// 
// 	public double getTime() {
// 		return time;
// 	}
// 
// 	public double getFrequency() {
// 		return frequency;
// 	}
// 
// 	public double getIntensity() {
// 		return intensity;
// 	}
// 		
// 	public int getTick() {
// 		return x;
// 	}
// 		
// 	public int getBin() {
// 		return y;
// 	}
// 		
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + x;
// 		result = prime * result + y;
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		Star other = (Star) obj;
// 		if (x != other.x)
// 			return false;
// 		if (y != other.y)
// 			return false;
// 		return true;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Star [x=" + x + ", y=" + y + ", intensity=" + intensity + "]";
// 	}
// }


// Path: src/java/org/sidoh/song_recognition/signature/StarBuffer.java
import java.util.Iterator;
import org.sidoh.song_recognition.signature.ConstellationMap.Star;
import org.sidoh.song_recognition.spectrogram.Spectrogram;

	protected final Spectrogram spec;

	public StarBuffer(Spectrogram spec) {
		this.spec = spec;
	}

	/**
	 * Offer a {@link Star} to this buffer. It may or may not accept it, and this 
	 * {@link Star} may or may not be returned by {@link #flush()} depending on
	 * how the internal logic works.
	 * 
	 * @param s
	 */
	public abstract void offerStar(Star s);
	
	/**
	 * Returns a list of stars it'd like to keep.
	 * 
	 * @return
	 */
	public abstract Iterable<Star> flush();
	
	public static StarBuffer.Builder coordinateAgnostic(double starDensityFactor) {
		return new CoordinateAgnosticStarBuffer.Builder(starDensityFactor);
	}
	
	public static StarBuffer.Builder evenlySpreadInTime(double starDensityFactor) {
		return new EvenlySpreadInTimeStarBuffer.Builder(starDensityFactor);
	}
	
	public static StarBuffer.Builder evenlySpreadInFrequency(double starDensityFactor) {