/* * Trial.java * * Created on May 14, 2007, 11:28 AM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ /** * *Represents a single sampling at a single instance of time for one person and *holds all data fields for that sampling. * * @author Matt DesVoigne */ public class Trial { private int participantID; // The participant sampled. private double[] fields; // The data fields for the sampling. /** Creates a new instance of Trial */ public Trial(int partID, double[] properties) { participantID = partID; fields = properties; } public int getParticipantID() { return participantID; } /** *Returns the data field of the sampling corresponding to the passed index. */ public double getProperty(int idx) { return fields[idx]; } /** * Returns true if the value of the input is not infinite and not Double.NaN. False otherwise. Used for ignoring blank cells. */ public static boolean isNumber (double num) { return(!Double.isNaN(num) && !Double.isInfinite(num)); } }