Soheila DehghanZadeh
Soheila DehghanZadeh

Reputation: 419

get last update Date of hashmap entries

I want to access the last update time of entries inside a hashmap. i'm wondering if java can provide me with this information or i need to store them somewhere and retrieve them.

Upvotes: 1

Views: 223

Answers (1)

peter
peter

Reputation: 15119

You will need to store them somewhere extra.

Or you can create your custom map implementation which would either extend Java's hashmap or use an hashmap internally and would additionally remember the last date of any action performed on your dataset, you seek to remember.

This would have the advantage that it would be ubiquitous and you wouldn't need to care about it within your algorithm, which uses the hashmap

Upvotes: 2

Related Questions