Skip to content

Instantly share code, notes, and snippets.

@astro-gokart
Created April 22, 2015 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astro-gokart/0f5f5845ffef9841da8b to your computer and use it in GitHub Desktop.
Save astro-gokart/0f5f5845ffef9841da8b to your computer and use it in GitHub Desktop.
package main;
import java.util.Comparator;
/**
* Created by charles on 4/19/15.
*/
public class Job implements Comparable<Job>{
String id;
int arrives, burst, elapsed;
boolean finished;
boolean arrived;
boolean running;
public Job(String id, int arrives, int burst) {
this.arrives = arrives;
this.id = id;
this.burst = burst;
this.elapsed = burst;
this.finished = false;
this.running = false;
this.arrived = false;
}
public boolean isArriving(int time) {
if(time == arrives)
return true;
return false;
}
@Override
public int compareTo(Job job) {
return this.arrives - job.arrives;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment