com.datastax.data.dataset.provider.AbstractTask Maven / Gradle / Ivy
package com.datastax.data.dataset.provider;
public abstract class AbstractTask implements Task {
private int min = 0;
private int max = 100;
private int progress = 0;
private boolean indeterminate = true;
private boolean cancellable = false;
private boolean modal = true;
protected void setMinimum(int val) {
min = val < 0 || val > max ? 0 : val;
}
protected void setMaximum(int val) {
max = val < 0 || val < min ? min : val;
}
protected void setProgress(int progress) {
this.progress = progress < 0 ? 0 : progress;
}
protected void setIndeterminate(boolean b) {
indeterminate = b;
}
public int getMinimum() {
return min;
}
public int getMaximum() {
return max;
}
public int getProgress() {
return progress;
}
public boolean isIndeterminate() {
return indeterminate;
}
public boolean isModal() {
return modal;
}
public boolean canCancel() {
return cancellable;
}
public void setModel(boolean b) {
modal = b;
}
public void setCanCancel(boolean b) {
cancellable = b;
}
}