R
R
renniqs2017-10-31 11:41:41
Java
renniqs, 2017-10-31 11:41:41

Do you need an algorithm for determining that a new element has been added to the collection?

The task is the following, there is a collection private Map dataFromRisCarton = new LinkedHashMap<>();
Data is written to it (with http post). How to find out that a new element has been added to the collection and display it?
Probably there is a ready algorithm.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cr2ed, 2017-10-31
@Cr2ed

Make a successor from LinkedHashMap. Override the add method and add all new elements in it to the adjacent list. Also add a method that displays new elements and at the same time clears the list of new elements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question