Checkpoint: ExchangeServiceTest

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
2021-01-13 12:23:00 +01:00
parent f9a27abb32
commit ed528ad9a0
4 changed files with 207 additions and 142 deletions

View File

@ -1,5 +1,7 @@
package com.plannaplan.models;
import java.sql.Timestamp;
import com.plannaplan.entities.Assignment;
import com.plannaplan.entities.Exchange;
@ -55,4 +57,12 @@ public class MatchData {
// Compare the data members and return accordingly
return (this.getAssignmentOne().equals(c.getAssignmentOne()) && this.getAssignmentTwo().equals(c.getAssignmentTwo())) || (this.getAssignmentOne().equals(c.getAssignmentTwo()) && this.getAssignmentTwo().equals(c.getAssignmentOne()));
}
public int compare(MatchData m1) {
return Float.compare(m1.getExchangesMsValue(), this.getExchangesMsValue());
}
public float getExchangesMsValue(){
return this.exchangeOne.getDataExchange().getTime() + this.exchangeTwo.getDataExchange().getTime();
}
}