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.cox;
022
023import java.util.LinkedHashMap;
024
025/**
026 * Contains info for graphing km figures
027 *
028 * @author Scooter Willis <willishf at gmail dot com>
029 */
030public class SurvFitInfo {
031
032        private LinkedHashMap<String, StrataInfo> strataInfoHashMap = new LinkedHashMap<String, StrataInfo>();
033        private LinkedHashMap<String, StrataInfo> unweightedStrataInfoHashMap = new LinkedHashMap<String, StrataInfo>();
034        private boolean weighted = false;
035
036
037        /**
038         *
039         * @return
040         */
041        public LinkedHashMap<String, StrataInfo> getUnweightedStrataInfoHashMap() {
042                return unweightedStrataInfoHashMap;
043        }
044
045        /**
046         *
047         * @param unweightedStrataInfoHashMap
048         */
049        public void setUnweightedStrataInfoHashMap(LinkedHashMap<String, StrataInfo> unweightedStrataInfoHashMap) {
050                this.unweightedStrataInfoHashMap = unweightedStrataInfoHashMap;
051        }
052
053        /**
054         * @return the strataInfoHashMap
055         */
056        public LinkedHashMap<String, StrataInfo> getStrataInfoHashMap() {
057                return strataInfoHashMap;
058        }
059
060        /**
061         * @param strataInfoHashMap the strataInfoHashMap to set
062         */
063        public void setStrataInfoHashMap(LinkedHashMap<String, StrataInfo> strataInfoHashMap) {
064                this.strataInfoHashMap = strataInfoHashMap;
065        }
066
067        /**
068         *
069         * @param siHashMap
070         * @param label
071         */
072        public void addStrataInfoHashMap(LinkedHashMap<String, StrataInfo> siHashMap, String label) {
073                for (String key : siHashMap.keySet()) {
074                        StrataInfo si = siHashMap.get(key);
075                        strataInfoHashMap.put(label + " " + key, si);
076                }
077        }
078
079        @Override
080        public String toString() {
081                return strataInfoHashMap.toString(); //To change body of generated methods, choose Tools | Templates.
082        }
083
084        /**
085         * @return the weighted
086         */
087        public boolean isWeighted() {
088                return weighted;
089        }
090
091        /**
092         * @param weighted the weighted to set
093         */
094        public void setWeighted(boolean weighted) {
095                this.weighted = weighted;
096        }
097}