Search in sources :

Example 31 with Counter

use of uk.ac.sussex.gdsc.smlm.results.count.Counter in project GDSC-SMLM by aherbert.

the class CounterTest method canIncrementAndGet.

@Test
void canIncrementAndGet() {
    Counter counter = new Counter();
    Assertions.assertEquals(1, counter.incrementAndGet());
    Assertions.assertEquals(2, counter.incrementAndGet());
    Assertions.assertEquals(3, counter.incrementAndGet());
    counter = new Counter();
    Assertions.assertEquals(10, counter.incrementAndGet(10));
    Assertions.assertEquals(20, counter.incrementAndGet(10));
    Assertions.assertEquals(30, counter.incrementAndGet(10));
}
Also used : Counter(uk.ac.sussex.gdsc.smlm.results.count.Counter) Test(org.junit.jupiter.api.Test)

Example 32 with Counter

use of uk.ac.sussex.gdsc.smlm.results.count.Counter in project GDSC-SMLM by aherbert.

the class CounterTest method canDecrementAndGet.

@Test
void canDecrementAndGet() {
    Counter counter = new Counter();
    Assertions.assertEquals(-1, counter.decrementAndGet());
    Assertions.assertEquals(-2, counter.decrementAndGet());
    Assertions.assertEquals(-3, counter.decrementAndGet());
    counter = new Counter();
    Assertions.assertEquals(-10, counter.decrementAndGet(10));
    Assertions.assertEquals(-20, counter.decrementAndGet(10));
    Assertions.assertEquals(-30, counter.decrementAndGet(10));
}
Also used : Counter(uk.ac.sussex.gdsc.smlm.results.count.Counter) Test(org.junit.jupiter.api.Test)

Aggregations

Counter (uk.ac.sussex.gdsc.smlm.results.count.Counter)32 MemoryPeakResults (uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults)27 List (java.util.List)25 PeakResult (uk.ac.sussex.gdsc.smlm.results.PeakResult)23 PeakResultProcedure (uk.ac.sussex.gdsc.smlm.results.procedures.PeakResultProcedure)22 SimpleArrayUtils (uk.ac.sussex.gdsc.core.utils.SimpleArrayUtils)17 FrameCounter (uk.ac.sussex.gdsc.smlm.results.count.FrameCounter)17 IJ (ij.IJ)15 AtomicReference (java.util.concurrent.atomic.AtomicReference)15 ImageJUtils (uk.ac.sussex.gdsc.core.ij.ImageJUtils)15 ExtendedGenericDialog (uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog)14 ArrayList (java.util.ArrayList)13 Nullable (uk.ac.sussex.gdsc.core.annotation.Nullable)13 ClassificationResult (uk.ac.sussex.gdsc.core.match.ClassificationResult)13 DistanceUnit (uk.ac.sussex.gdsc.smlm.data.config.UnitProtos.DistanceUnit)13 PlugIn (ij.plugin.PlugIn)12 FractionClassificationResult (uk.ac.sussex.gdsc.core.match.FractionClassificationResult)12 Chromosome (uk.ac.sussex.gdsc.smlm.ga.Chromosome)12 XStreamOmitField (com.thoughtworks.xstream.annotations.XStreamOmitField)11 Rectangle (java.awt.Rectangle)11