[22272] | 1 | package org.greenstone.server;
|
---|
| 2 |
|
---|
| 3 | public class ScanConfiguration
|
---|
| 4 | {
|
---|
| 5 | protected double _penaltyPercentage = -1;
|
---|
| 6 | protected double _parentBonusPercentage = -1;
|
---|
| 7 | protected double _indirectReferencePercentage = -1;
|
---|
| 8 | protected double _parentLimitPercentage = -1;
|
---|
| 9 |
|
---|
| 10 | public ScanConfiguration(double penaltyPercentage, double parentBonusPercentage, double indirectReferencePercentage, double parentLimitPercentage)
|
---|
| 11 | {
|
---|
| 12 | _penaltyPercentage = penaltyPercentage;
|
---|
| 13 | _parentBonusPercentage = parentBonusPercentage;
|
---|
| 14 | _indirectReferencePercentage = indirectReferencePercentage;
|
---|
| 15 | _parentLimitPercentage = parentLimitPercentage;
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | public double getPenalty()
|
---|
| 19 | {
|
---|
| 20 | return _penaltyPercentage;
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | public double getParentBonus()
|
---|
| 24 | {
|
---|
| 25 | return _parentBonusPercentage;
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | public double getIndirectReferencePenalty()
|
---|
| 29 | {
|
---|
| 30 | return _indirectReferencePercentage;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | public String toString()
|
---|
| 34 | {
|
---|
| 35 | return "" + _penaltyPercentage + " " + _parentBonusPercentage + " " + _indirectReferencePercentage + " " + _parentLimitPercentage;
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | public boolean equals (Object other)
|
---|
| 39 | {
|
---|
| 40 | if(other == null)
|
---|
| 41 | {
|
---|
| 42 | return false;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | if(!(other instanceof ScanConfiguration))
|
---|
| 46 | {
|
---|
| 47 | return false;
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | ScanConfiguration othersc = (ScanConfiguration)other;
|
---|
| 51 |
|
---|
| 52 | if(_penaltyPercentage == othersc.getPenalty() && _parentBonusPercentage == othersc.getParentBonus() && _indirectReferencePercentage == othersc.getIndirectReferencePenalty())
|
---|
| 53 | {
|
---|
| 54 | return true;
|
---|
| 55 | }
|
---|
| 56 | return false;
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | public double getParentLimit()
|
---|
| 60 | {
|
---|
| 61 | return _parentLimitPercentage;
|
---|
| 62 | }
|
---|
| 63 | }
|
---|