[abportal] Annotation of /src/main/java/eu/smartlm/abs/portal/view/portlet/model/SmartLMUsageRecordTypeSorted.java
Annotation of /src/main/java/eu/smartlm/abs/portal/view/portlet/model/SmartLMUsageRecordTypeSorted.java
Parent Directory
| Revision Log
Revision 1 -
(view)
(download)
1 : |
dgarcia |
1 |
package eu.smartlm.abs.portal.view.portlet.model;
|
2 : |
|
|
|
3 : |
|
|
import java.util.Calendar;
|
4 : |
|
|
|
5 : |
|
|
import eu.smartlm.schemas.x2009.x06.urec.SmartLMUsageRecordType;
|
6 : |
|
|
|
7 : |
|
|
public class SmartLMUsageRecordTypeSorted implements Comparable<SmartLMUsageRecordTypeSorted> {
|
8 : |
|
|
|
9 : |
|
|
private Calendar date;
|
10 : |
|
|
private SmartLMUsageRecordType usagerecord;
|
11 : |
|
|
|
12 : |
|
|
public SmartLMUsageRecordTypeSorted(SmartLMUsageRecordType usagerecord) {
|
13 : |
|
|
this.setUsagerecord(usagerecord);
|
14 : |
|
|
date = usagerecord.getLicenseResourceArray(0).getAccountingPeriod().getStartTime();
|
15 : |
|
|
}
|
16 : |
|
|
|
17 : |
|
|
public Calendar getDate() {
|
18 : |
|
|
return date;
|
19 : |
|
|
}
|
20 : |
|
|
|
21 : |
|
|
public int compareTo(SmartLMUsageRecordTypeSorted o) {
|
22 : |
|
|
return -date.compareTo(o.getDate());
|
23 : |
|
|
}
|
24 : |
|
|
|
25 : |
|
|
private void setUsagerecord(SmartLMUsageRecordType usagerecord) {
|
26 : |
|
|
this.usagerecord = usagerecord;
|
27 : |
|
|
}
|
28 : |
|
|
|
29 : |
|
|
public SmartLMUsageRecordType getUsagerecord() {
|
30 : |
|
|
return usagerecord;
|
31 : |
|
|
}
|
32 : |
|
|
}
|
|