java.lang.Object
edu.ntnu.idata1002.prosjekt2021.model.Careplan
public class Careplan
extends java.lang.Object
Represents a patients careplan. Contains the specified type
of care in the plan. Holds on list over the tasks associated with
this type of care, and a list over journal entries associated with
this type of care.
-
Constructor Summary
Constructors Constructor Description Careplan(java.lang.String typeOfCare)
Creates an instance of careplan. -
Method Summary
Modifier and Type Method Description void
addJournalEntry(JournalEntry journalEntry)
Adds a journal entry to the journal.void
addTask(TodoTask todoTask)
Adds a task to the careplan.void
changeTaskPositionDown(TodoTask todoTask)
Changes the position of the given todoTask with one spot up.void
changeTaskPositionUp(TodoTask todoTask)
Changes the position of the given todotask with one spot down.void
changeTaskPostitionBottom(TodoTask todoTask)
Changes the position of the given to do task to the bottom of the ArrayList.void
changeTaskPostitionTop(TodoTask todoTask)
Changes the position of the given todoTask to the top of the ArrayList.TodoTask
findTaskByCheckBox(javafx.scene.control.CheckBox checkBox)
Iterates over the list of todotasks and returns the todotask with the matching checkbox.java.util.List<JournalEntry>
getJournal()
Returns the journal(list) that cointains the journal entries.java.util.List<TodoTask>
getTasks()
Returns the list of tasks in this careplan.java.util.List<TodoTask>
getTasksByTimeOfDay(java.lang.String timeOfDay)
Returns a list over tasks in this careplan with the deadline of the given time of day.java.lang.String
getTypeOfCare()
Returns the type of care in this careplan.void
removeTask(TodoTask todoTask)
Removes task from the careplan.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Careplan
public Careplan(java.lang.String typeOfCare)Creates an instance of careplan.- Parameters:
typeOfCare
- the type of cate of the careplan instance.
-
-
Method Details
-
addTask
Adds a task to the careplan.- Parameters:
todoTask
- task to be added to careplan.
-
removeTask
Removes task from the careplan.- Parameters:
todoTask
- task to be removed from careplan.
-
changeTaskPositionUp
Changes the position of the given todotask with one spot down.- Parameters:
todoTask
- the task to be moved up in the list
-
changeTaskPositionDown
Changes the position of the given todoTask with one spot up.- Parameters:
todoTask
- todotask to be places one spot up.
-
changeTaskPostitionBottom
Changes the position of the given to do task to the bottom of the ArrayList.- Parameters:
todoTask
- todoTask to be placed at the bottom.
-
changeTaskPostitionTop
Changes the position of the given todoTask to the top of the ArrayList.- Parameters:
todoTask
- todoTask to be places at top.
-
findTaskByCheckBox
Iterates over the list of todotasks and returns the todotask with the matching checkbox. If no matches are found, null will be returned.- Parameters:
checkBox
- the checkbox to find to the corresponding todotask item for.- Returns:
- todotask with the corresponding checkbox, or null if no matches are found.
-
getTypeOfCare
public java.lang.String getTypeOfCare()Returns the type of care in this careplan.- Returns:
- type of care in this careplan.
-
getTasks
Returns the list of tasks in this careplan.- Returns:
- list of tasks in this careplan.
-
getTasksByTimeOfDay
Returns a list over tasks in this careplan with the deadline of the given time of day.- Parameters:
timeOfDay
- the time of day of the tasks to find.- Returns:
- list over tasks in this careplan to be done at the specified time of day.
-
addJournalEntry
Adds a journal entry to the journal.- Parameters:
journalEntry
- the entry to be added to the journal.
-
getJournal
Returns the journal(list) that cointains the journal entries.- Returns:
- journal(list) that contains the journal entries.
-