Package com.example.cardiacrecorder
Class RecordList
java.lang.Object
com.example.cardiacrecorder.RecordList
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecord(RecordModel recordModel) Adds a record to the list of records.intcount()Returns the counts of the recordsvoiddeleteRecord(int position) Deletes a record from the list at the specified position.
-
Field Details
-
arrayList
-
-
Constructor Details
-
RecordList
public RecordList()
-
-
Method Details
-
addRecord
Adds a record to the list of records.- Parameters:
recordModel- The RecordModel object to be added.- Throws:
IllegalArgumentException- If the recordModel already exists in the list.
-
deleteRecord
public void deleteRecord(int position) Deletes a record from the list at the specified position.- Parameters:
position- The position to be deleted- Throws:
IllegalArgumentException- If the position is invalid.
-
count
public int count()Returns the counts of the records- Returns:
- The number of records.
-