You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Information on each performance needs to be logged, in order to display progress information to the user, among other things.
For each performance log:
ID for which melody/rhythm
Type of melody/rhythm (these are broad categories that group multiple different melodies/rhythms together)
What type of performance (i.e. sight singing, or rhythm)
Total score
Pitch score (not for rhythms)
Rhythm score
Date when the performance was done
Total time spent (in seconds) on the exercise (total elapsed time from when the user was prompted with with a melody/rhythm to when they moved on to the next exercise, or stopped practicing)
After each performance, a record will be stored for that performance. As such, I need a way to write a single new record to the disk without reading in the entire set of stored records. I believe there is a way to do this using ObjectOutuputStreams. The records will be serialized and written to a file. Then later, when they need to be read, they can be deserialized and turned into Java objects again.
For now the records can be stored as a flat list. There should be one file on the disk that stores all records for sight singing, and another file to store all records for rhythms.
A record will be stored for each performance when savePerformanceRecord() is called.
Some Implementation Details
Ideally, savePerformanceRecord() could be called with any type of PerformanceRecord and it would determine the right place to write it to (and also make sure all the specific fields for that type of PerformanceRecord are written).
In order to test, you'll have to make a UserConfiguration object and specify paths that the records will be written to.
There are additional comments in the code.
The methods to implement are: public void savePerformanceRecord(PerformanceRecord record); public List<SightSingingRecord> getSightSingingRecords(); public List<RhythmRecord> getRhythmRecords(); public HashMap<String, List<SightSingingRecord>> readSightSingingRecords(); public HashMap<String, List<RhythmRecord>> readRhythmRecords();
The text was updated successfully, but these errors were encountered:
Information on each performance needs to be logged, in order to display progress information to the user, among other things.
For each performance log:
After each performance, a record will be stored for that performance. As such, I need a way to write a single new record to the disk without reading in the entire set of stored records. I believe there is a way to do this using ObjectOutuputStreams. The records will be serialized and written to a file. Then later, when they need to be read, they can be deserialized and turned into Java objects again.
Reading and writing Serializable objects:
http://www.javapractices.com/topic/TopicAction.do?Id=57
Way to append object to serialized file:
http://stackoverflow.com/questions/15607969/appending-objects-to-a-serialization-file
http://stackoverflow.com/questions/2094637/how-can-i-append-to-an-existing-java-io-objectstream
For now the records can be stored as a flat list. There should be one file on the disk that stores all records for sight singing, and another file to store all records for rhythms.
A record will be stored for each performance when savePerformanceRecord() is called.
Some Implementation Details
Ideally, savePerformanceRecord() could be called with any type of PerformanceRecord and it would determine the right place to write it to (and also make sure all the specific fields for that type of PerformanceRecord are written).
In order to test, you'll have to make a UserConfiguration object and specify paths that the records will be written to.
There are additional comments in the code.
The methods to implement are:
public void savePerformanceRecord(PerformanceRecord record);
public List<SightSingingRecord> getSightSingingRecords();
public List<RhythmRecord> getRhythmRecords();
public HashMap<String, List<SightSingingRecord>> readSightSingingRecords();
public HashMap<String, List<RhythmRecord>> readRhythmRecords();
The text was updated successfully, but these errors were encountered: