Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Source code recreated from a .class file by IntelliJ IDEA
- // (powered by FernFlower decompiler)
- //
- package WorkSchedule;
- public class WorkSchedule {
- private WorkSchedule.Hour[] hours;
- public WorkSchedule(int paramInt) {
- this.hours = new WorkSchedule.Hour[paramInt];
- for(int i = 0; i < paramInt; ++i) {
- this.hours[i] = new WorkSchedule.Hour();
- this.hours[i].requiredNumber = 0;
- this.hours[i].workingEmployees = new String[0];
- }
- }
- public WorkSchedule.Hour readSchedule(int paramInt) {
- return this.hours[paramInt];
- }
- public void setRequiredNumber(int paramInt1, int paramInt2, int paramInt3) {
- for(int i = paramInt2; i <= paramInt3; ++i) {
- this.hours[i].requiredNumber = paramInt1;
- }
- }
- public boolean addWorkingPeriod(String paramString, int paramInt1, int paramInt2) {
- if (paramInt1 >= 0 && paramInt2 < this.hours.length) {
- int i;
- for(i = paramInt1; i <= paramInt2; ++i) {
- for(int j = 0; j < this.hours[i].workingEmployees.length; ++j) {
- if (this.hours[i].workingEmployees[j].equals(paramString)) {
- return false;
- }
- }
- if (this.hours[i].requiredNumber == this.hours[i].workingEmployees.length) {
- return false;
- }
- }
- for(i = paramInt1; i <= paramInt2; ++i) {
- String[] arrayOfString = new String[this.hours[i].workingEmployees.length + 1];
- for(int k = 0; k < this.hours[i].workingEmployees.length; ++k) {
- arrayOfString[k] = this.hours[i].workingEmployees[k];
- }
- arrayOfString[this.hours[i].workingEmployees.length] = paramString;
- this.hours[i].workingEmployees = arrayOfString;
- }
- return true;
- } else {
- return false;
- }
- }
- public String[] workingEmployees(int paramInt1, int paramInt2) {
- String[] arrayOfString1 = new String[this.hours[paramInt1].workingEmployees.length + this.hours[paramInt2].workingEmployees.length];
- int i = 0;
- int k;
- int j;
- for(j = 0; j < this.hours[paramInt1].workingEmployees.length; ++j) {
- for(k = 0; k < i && !arrayOfString1[k].equals(this.hours[paramInt1].workingEmployees[j]); ++k) {
- }
- if (k == i) {
- arrayOfString1[i++] = this.hours[paramInt1].workingEmployees[j];
- }
- }
- for(j = 0; j < this.hours[paramInt2].workingEmployees.length; ++j) {
- for(k = 0; k < i && !arrayOfString1[k].equals(this.hours[paramInt2].workingEmployees[j]); ++k) {
- }
- if (k == i) {
- arrayOfString1[i++] = this.hours[paramInt2].workingEmployees[j];
- }
- }
- String[] arrayOfString2 = new String[i];
- for(k = 0; k < i; ++k) {
- arrayOfString2[k] = arrayOfString1[k];
- }
- return arrayOfString2;
- }
- public int nextIncomplete(int paramInt) {
- for(int i = paramInt; i < this.hours.length; ++i) {
- if (this.hours[i].requiredNumber > this.hours[i].workingEmployees.length) {
- return i;
- }
- }
- return -1;
- }
- public class Hour {
- int requiredNumber;
- String[] workingEmployees;
- public Hour() {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement