1 package at.ac.tuwien.lsdc.types;
3 public class Application implements Comparable<Application> {
6 private long timestamp;
12 private VirtualMachine runningOn;
14 public Application(int id, long timestamp, int size, int ram, int cpu,
17 this.timestamp = timestamp;
21 this.duration = duration;
28 public long getTimestamp() {
32 public int getSize() {
44 public int getDuration() {
48 public String toString() {
49 return new String("App ID: " + id + " Timestamp: " + timestamp
50 + " size: " + size + " ram: " + ram + " cpu: " + cpu
51 + " duration: " + duration);
54 public VirtualMachine getRunningOn() {
58 public void setRunningOn(VirtualMachine vm) {
63 public int compareTo(Application other) {
64 final int BEFORE = -1;
68 // this optimization is usually worthwhile, and can
72 if (this.getTimestamp() == other.getTimestamp())
74 if (this.getTimestamp() < other.getTimestamp())
76 if (this.getTimestamp() > other.getTimestamp())