001package org.cpsolver.studentsct.report;
002
003import org.cpsolver.ifs.assignment.Assignment;
004import org.cpsolver.ifs.util.CSVFile;
005import org.cpsolver.ifs.util.DataProperties;
006import org.cpsolver.studentsct.model.Course;
007import org.cpsolver.studentsct.model.Enrollment;
008import org.cpsolver.studentsct.model.Request;
009import org.cpsolver.studentsct.model.Student;
010
011/**
012 * Simple interface for student sectioning reports.
013 * 
014 * <br>
015 * <br>
016 * 
017 * Usage: new DistanceConflictTable(model),createTable(true, true).save(aFile);
018 * 
019 * <br>
020 * <br>
021 * 
022 * @version StudentSct 1.3 (Student Sectioning)<br>
023 *          Copyright (C) 2013 - 2014 Tomáš Müller<br>
024 *          <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
025 *          <a href="http://muller.unitime.org">http://muller.unitime.org</a><br>
026 * <br>
027 *          This library is free software; you can redistribute it and/or modify
028 *          it under the terms of the GNU Lesser General Public License as
029 *          published by the Free Software Foundation; either version 3 of the
030 *          License, or (at your option) any later version. <br>
031 * <br>
032 *          This library is distributed in the hope that it will be useful, but
033 *          WITHOUT ANY WARRANTY; without even the implied warranty of
034 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
035 *          Lesser General Public License for more details. <br>
036 * <br>
037 *          You should have received a copy of the GNU Lesser General Public
038 *          License along with this library; if not see
039 *          <a href='http://www.gnu.org/licenses/'>http://www.gnu.org/licenses/</a>.
040 */
041public interface StudentSectioningReport {
042    public CSVFile create(Assignment<Request, Enrollment> assignment, DataProperties properties);
043    
044    /**
045     * Report filtering interface
046     */
047    public interface Filter {
048        /** Returns true if the given request matches the filter.
049         * {@link #matches(Request, Enrollment)} is called with the current assignment.
050         * */
051        public boolean matches(Request r);
052        /** Returns true if the given request with the given assignment matches the filter. */
053        public boolean matches(Request r, Enrollment e);
054        /** Returns true if the given student matches the filter.
055         * This means that a student has a request that matches the filter. */
056        public boolean matches(Student s);
057        /** Returns true if the given course matches the filter.
058         * This means that a student has a request for the course that matches the filter. */
059        public boolean matches(Course c);
060    }
061}