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, int duration) {
16 this.timestamp = timestamp;
20 this.duration = duration;
27 public long getTimestamp() {
31 public int getSize() {
43 public int getDuration() {
48 public String toString() {
49 return new String("App ID: " + id + " Timestamp: " + timestamp + " size: " + size
50 + " ram: " + ram + " cpu: " + cpu + " duration: " + duration);
53 public VirtualMachine getRunningOn() {
57 public void setRunningOn(VirtualMachine vm) {
62 public int compareTo(Application other) {
63 final int BEFORE = -1;
67 // this optimization is usually worthwhile, and can
71 if (this.getTimestamp() == other.getTimestamp())
73 if (this.getTimestamp() < other.getTimestamp())
75 if (this.getTimestamp() > other.getTimestamp())