java - More efficient method of updating observableList -


here's setup:

i have mysql database data.

i have makeshift server built downloads data , turns observablelist , client can make own copy of observablelist, call locallist.

if want make new entry, requirements dictate must done sending new entry sql database, server downloads it, client pulls update,then client sees update. (this done since multiple clients accessing database).

here's problem: currently, way when make new entry, server clears observablelist, fills again, , client clears locallist , fills again.

i not have worry server code (it replaced more sophisticated server), wondering if locallist (from observablelist) comes method can compare list , make changes accordingly.

instead of doing

observablelist<mytype> locallist = fxcollections.observablearraylist();  .... locallist.clear(); (mytype element : serverlist) {     locallist.add(element); } 

each time make new entry, there more efficient way? type of update method possibly?

basically question boils down to:

is there way of setting observablelist<mytype> equal without clearing list , adding elements 1 one.

does

bindings.bindcontent(locallist, serverlist); 

do need? (javadocs). work if keep same list instance in serverlist, , don't reassign reference.


Comments