Created
April 22, 2015 02:30
-
-
Save astro-gokart/0f5f5845ffef9841da8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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