001    package market;
002    
003    import java.io.Serializable;
004    
005    /**
006     * Contains some variables which affect the computation of the discount and the dismissal compensation.
007     */
008    public class Options implements Serializable {
009    
010        private int discountRange = 12;
011        private double maxDiscount = 0.35;
012        private int discountValue = 15000;
013        private double fractionOfWages = 1;
014        private double timeOfEmployment = 0.05;
015    
016        /**
017         * @return the number of months which have influence on the discount.
018         */
019        public int getDiscountRange() {
020            return discountRange;
021        }
022    
023        /**
024         * Sets the number of months which have influence on the discount.
025         * @param range the number of months
026         */
027        public void setDiscountRange(int range) {
028            discountRange = range;
029        }
030    
031        /**
032         * @return the maximal discount that can be allowed.
033         */
034        public double getMaxDiscount() {
035            return maxDiscount;
036        }
037    
038        /**
039         * Sets the maximal discount that can be allowed.
040         * @param max the maximal discount.
041         */
042        public void setMaxDiscount(double max) {
043            maxDiscount = Conversions.round(max, 5);
044        }
045    
046        /**
047         * @return the money in Euros that are worth one percent discount.
048         */
049        public int getDiscountValue() {
050            return discountValue;
051        }
052    
053        /**
054         * Sets the money in Euros that are worth one percent discount.
055         * @param value the money in Euros.
056         */
057        public void setDiscountValue(int value) {
058            discountValue = value;
059        }
060    
061        /**
062         * @return the influence the current wage has on the computation of the dismissal compensation.
063         */
064        public double getFractionOfWages() {
065            return fractionOfWages;
066        }
067    
068        /**
069         * Sets the influence the current wage has on the computation of the dismissal compensation.
070         * @param fraction the influence of the wage in percent.
071         */
072        public void setFractionOfWages(double fraction) {
073            fractionOfWages = Conversions.round(fraction, 5);
074        }
075    
076        /**
077         * @return the influence the time the worker has been employed has on the computation of the
078         * dismissal compensation.
079         */
080        public double getTimeOfEmployment() {
081            return timeOfEmployment;
082        }
083    
084        /**
085         * Sets the influence the time the worker has been employed has on the computation of the dismissal
086         * compensation.
087         * @param fraction the influence of the time in percent.
088         */
089        public void setTimeOfEmployment(double fraction) {
090            timeOfEmployment = Conversions.round(fraction, 5);
091        }
092    }