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 /** 011 * ID for serialization. 012 */ 013 private static final long serialVersionUID = 2421549680479102792L; 014 015 private int discountRange = 12; 016 private double maxDiscount = 0.35; 017 private int discountValue = 15000; 018 private double fractionOfWages = 1; 019 private double timeOfEmployment = 0.05; 020 021 /** 022 * @return the number of months which have influence on the discount. 023 */ 024 public int getDiscountRange() { 025 return discountRange; 026 } 027 028 /** 029 * Sets the number of months which have influence on the discount. 030 * @param range the number of months 031 */ 032 public void setDiscountRange(int range) { 033 discountRange = range; 034 } 035 036 /** 037 * @return the maximal discount that can be allowed. 038 */ 039 public double getMaxDiscount() { 040 return maxDiscount; 041 } 042 043 /** 044 * Sets the maximal discount that can be allowed. 045 * @param max the maximal discount. 046 */ 047 public void setMaxDiscount(double max) { 048 maxDiscount = Conversions.round(max, 5); 049 } 050 051 /** 052 * @return the money in Euros that are worth one percent discount. 053 */ 054 public int getDiscountValue() { 055 return discountValue; 056 } 057 058 /** 059 * Sets the money in Euros that are worth one percent discount. 060 * @param value the money in Euros. 061 */ 062 public void setDiscountValue(int value) { 063 discountValue = value; 064 } 065 066 /** 067 * @return the influence the current wage has on the computation of the dismissal compensation. 068 */ 069 public double getFractionOfWages() { 070 return fractionOfWages; 071 } 072 073 /** 074 * Sets the influence the current wage has on the computation of the dismissal compensation. 075 * @param fraction the influence of the wage in percent. 076 */ 077 public void setFractionOfWages(double fraction) { 078 fractionOfWages = Conversions.round(fraction, 5); 079 } 080 081 /** 082 * @return the influence the time the worker has been employed has on the computation of the 083 * dismissal compensation. 084 */ 085 public double getTimeOfEmployment() { 086 return timeOfEmployment; 087 } 088 089 /** 090 * Sets the influence the time the worker has been employed has on the computation of the dismissal 091 * compensation. 092 * @param fraction the influence of the time in percent. 093 */ 094 public void setTimeOfEmployment(double fraction) { 095 timeOfEmployment = Conversions.round(fraction, 5); 096 } 097 }