All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hyperfoil.core.util.LowHigh Maven / Gradle / Ivy

There is a newer version: 0.27.1
Show newest version
package io.hyperfoil.core.util;

public class LowHigh {
   public final int low;
   public final int high;

   public LowHigh(int low, int high) {
      this.high = high;
      this.low = low;
   }

   public static LowHigh sum(LowHigh r1, LowHigh r2) {
      if (r1 == null) return r2;
      if (r2 == null) return r1;
      return new LowHigh(r1.low + r2.low, r1.high + r2.high);
   }

   public static LowHigh combine(LowHigh r1, LowHigh r2) {
      if (r1 == null) return r2;
      if (r2 == null) return r1;
      return new LowHigh(Math.min(r1.low, r2.low), Math.max(r1.high, r2.high));
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy