X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fquery%2FValueUpdateSet.java;h=e2c44a79e300981b27092684e44fa8af7f29d6f7;hb=a88c02c2d0f4250caf887a130b9f4314c6564722;hp=8e7144f4df144f991c9b6036fe4c9505a9ea325d;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ValueUpdateSet.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ValueUpdateSet.java index 8e7144f4d..e2c44a79e 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ValueUpdateSet.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ValueUpdateSet.java @@ -1,51 +1,51 @@ -package org.simantics.db.impl.query; - -import gnu.trove.procedure.TIntProcedure; -import gnu.trove.set.hash.TIntHashSet; - -final public class ValueUpdateSet { - - private int first = 0; - public TIntHashSet rest = new TIntHashSet(); - - public int size() { - if(first != 0) return 1; - else return rest.size(); - } - - public int getFirst() { - return first; - } - - public void add(int l) { - if(first == 0) { - if(rest.isEmpty()) { - first = l; - } else { - rest.add(l); - } - } else { - if(l == first) return; - rest.add(first); - rest.add(l); - first = 0; - } - } - - public void clear() { - first = 0; - if(!rest.isEmpty()) { - rest = new TIntHashSet(); - //System.err.println("new rest!"); - } - } - - public void forEach(TIntProcedure proc) { - if(first != 0) { - proc.execute(first); - } else { - rest.forEach(proc); - } - } - -} +package org.simantics.db.impl.query; + +import gnu.trove.procedure.TIntProcedure; +import gnu.trove.set.hash.TIntHashSet; + +final public class ValueUpdateSet { + + private int first = 0; + public TIntHashSet rest = new TIntHashSet(); + + public int size() { + if(first != 0) return 1; + else return rest.size(); + } + + public int getFirst() { + return first; + } + + public void add(int l) { + if(first == 0) { + if(rest.isEmpty()) { + first = l; + } else { + rest.add(l); + } + } else { + if(l == first) return; + rest.add(first); + rest.add(l); + first = 0; + } + } + + public void clear() { + first = 0; + if(!rest.isEmpty()) { + rest = new TIntHashSet(); + //System.err.println("new rest!"); + } + } + + public void forEach(TIntProcedure proc) { + if(first != 0) { + proc.execute(first); + } else { + rest.forEach(proc); + } + } + +}