Skip to content

Commit

Permalink
add functions : getAllSchedules
Browse files Browse the repository at this point in the history
  • Loading branch information
tlaabs committed Feb 7, 2019
1 parent 4fc21cb commit 1a4a494
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,35 @@ public void setOnStickerSelectEventListener(OnStickerSelectedListener listener)
stickerSelectedListener = listener;
}

/**
* date : 2019-02-08
* get all schedules TimetableView has.
*/
public ArrayList<Schedule> getAllSchedulesInStickers() {
ArrayList<Schedule> allSchedules = new ArrayList<Schedule>();
for (int key : stickers.keySet()) {
for (Schedule schedule : stickers.get(key).getSchedules()) {
allSchedules.add(schedule);
}
}
return allSchedules;
}

/**
* date : 2019-02-08
* Used in Edit mode, To check a invalidate schedule.
*/
public ArrayList<Schedule> getAllSchedulesInStickersExceptIdx(int idx) {
ArrayList<Schedule> allSchedules = new ArrayList<Schedule>();
for (int key : stickers.keySet()) {
if (idx == key) continue;
for (Schedule schedule : stickers.get(key).getSchedules()) {
allSchedules.add(schedule);
}
}
return allSchedules;
}

public void add(ArrayList<Schedule> schedules) {
add(schedules, -1);
}
Expand Down

0 comments on commit 1a4a494

Please sign in to comment.