001    package ttsolver;
002    
003    import ifs.solution.Solution;
004    import java.io.*;
005    
006    /**
007     * Abstract timetable saver class.
008     * 
009     * @author <a href="mailto:muller@ktiml.mff.cuni.cz">Tomáš Müller</a>
010     * @version 1.0
011     */
012    
013    public abstract class TimetableSaver {
014        private Solution iSolution = null;
015        /** Constructor
016         * @param solution solution to be saved
017         */
018        public TimetableSaver(Solution solution) {
019            iSolution = solution;
020        }
021        /** Solution to be saved */
022        protected Solution getSolution() { return iSolution; }
023        /** Model of the solution */
024        protected TimetableModel getModel() { return (TimetableModel)iSolution.getModel(); }
025        /** Save the solution
026         * @param out some error/warning/info messages could be printed here
027         */
028        public abstract void save(PrintWriter out) throws Exception;
029    }