erikaliang520 / base_KASE

2 stars 1 forks source link

Added attribute insertionOrder #40

Closed erikaliang520 closed 9 months ago

erikaliang520 commented 9 months ago

After reviewing Addison's code review of get( ) (pull request #37), I added a new ArrayList insertion order that keeps track of the order in which original words are added such that the newest ones are appended to the end. Then, I modified save() and get() to specifically loop through insertionOrder rather than entries of the wordHistory hashmap which may not maintain order. Additionally modified clearWordHistory(), save(Word, Word), and the constructor to update insertionOrder.