forked from nus-cs2103-AY1819S2/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package seedu.address.model.equipment; | ||
|
||
import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; | ||
|
||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* Representing a WorkList containing the equipments users want to work on. | ||
*/ | ||
public class WorkList { | ||
|
||
//Identity fields | ||
private final String date; | ||
private final String assignee; | ||
|
||
//Data fields | ||
private final Set<Equipment> equipments; | ||
|
||
/** | ||
* Every field must be present and not null. | ||
*/ | ||
public WorkList(String date, String name) { | ||
requireAllNonNull(date, name); | ||
this.date = date; | ||
this.assignee = name; | ||
this.equipments = new HashSet<>(); | ||
} | ||
|
||
public String getDate () { | ||
return date; | ||
} | ||
|
||
public String getAssignee () { | ||
return assignee; | ||
} | ||
|
||
public Set<Equipment> getEquipments() { | ||
return Collections.unmodifiableSet(equipments); | ||
} | ||
|
||
//Add an equipment to the work list. | ||
public void addEquipment (Equipment e) { | ||
this.equipments.add(e); | ||
} | ||
|
||
//Delete an equipment from the work list. | ||
public void deleteEquipment (Equipment e) { | ||
this.equipments.remove(e); | ||
} | ||
|
||
//List all the equipments in the work list. | ||
public Equipment[] listEquipment () { | ||
return (Equipment[]) this.equipments.toArray(); | ||
} | ||
} |