Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Channel {
- public static double currentTime;
- private int channelId;
- private double willFreeTime;
- private boolean isFree;
- public Channel(int channelId) {
- this.channelId = channelId;
- this.willFreeTime = 0;
- this.isFree = true;
- }
- public void setChannelId(int channelId) {
- this.channelId = channelId;
- }
- public int getChannelId() {
- return channelId;
- }
- public void setWillFreeTime(double willFreeTime) {
- this.willFreeTime = willFreeTime;
- }
- public double getWillFreeTime() {
- return willFreeTime;
- }
- public void setIsFree(boolean isFree) {
- this.isFree = isFree;
- }
- public boolean getIsFree() {
- return isFree;
- }
- public boolean CheckFree(double time) {
- return this.willFreeTime < time;
- }
- public boolean SetTask(double time) {
- if(this.isFree) {
- this.willFreeTime = currentTime + time;
- this.isFree = false;
- return true;
- }
- else return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement