001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021package org.biojava.nbio.survival.kaplanmeier.metadata;
022
023import org.biojava.nbio.survival.data.WorkSheet;
024
025import java.util.ArrayList;
026
027/**
028 *
029 * @author Scooter Willis <willishf at gmail dot com>
030 */
031public class MetaDataInfo {
032
033        /**
034         *
035         */
036        public String column = "";
037        /**
038         *
039         */
040        public boolean numeric = false;
041        /**
042         *
043         */
044        public DiscreteQuantizerInterface discreteQuantizer = null;
045        ArrayList<String> discreteValues = new ArrayList<String>();
046
047        /**
048         *
049         * @param column
050         * @param numeric
051         * @param discreteQuantizer
052         */
053        public MetaDataInfo(String column, boolean numeric, DiscreteQuantizerInterface discreteQuantizer) {
054                this.column = column;
055                this.numeric = numeric;
056                this.discreteQuantizer = discreteQuantizer;
057        }
058
059        /**
060         *
061         * @param column
062         */
063        public MetaDataInfo(String column) {
064                this.column = column;
065        }
066
067        /**
068         *
069         * @param worksheet
070         * @throws Exception
071         */
072        public void setDiscreteValues(WorkSheet worksheet) throws Exception {
073                discreteValues = worksheet.getDiscreteColumnValues(column);
074        }
075
076        /**
077         *
078         * @return
079         */
080        public ArrayList<String> getDiscreteValues() {
081                return discreteValues;
082        }
083
084        /**
085         *
086         * @return
087         */
088        public int getNumberDiscreteValues() {
089                return discreteValues.size();
090        }
091}