public void testMax_noArgs() { try { Longs.max(); fail(); } catch (IllegalArgumentException expected) { } }
public Builder setTimestamp(@Nonnegative final long timestamp) { this.timestamp = Longs.max(0, timestamp); return this; }
public Builder setDuration(@Nonnegative final long duration) { this.duration = Longs.max(0, duration); return this; }
public Builder setLastKnownGoodTimestamp(@Nonnegative final long lastKnownGoodTimestamp) { this.lastKnownGoodTimestamp = Longs.max(0, lastKnownGoodTimestamp); return this; }
public Builder setPeriod(@Nonnegative final long period) { this.period = Longs.max(0, period); return this; }
private void fillValues(IntValueLookup original) { final int BUFFER_SIZE = 8192; final int[] idBuffer = new int[BUFFER_SIZE]; final long[] valBuffer = new long[BUFFER_SIZE]; for (int start = 0; start < values.length; start += BUFFER_SIZE) { final int end = Math.min(values.length, start+BUFFER_SIZE), n = end-start; for (int i = 0; i < n; i++) { idBuffer[i] = start + i; } original.lookup(idBuffer, valBuffer, n); System.arraycopy(valBuffer, 0, values, start, n); } min = Longs.min(values); max = Longs.max(values); }
public void testMax_noArgs() { try { Longs.max(); fail(); } catch (IllegalArgumentException expected) { } }
private static Pair<Long, Long> getPreviousAndCurrentTimestamps(final Collection<Long> longs) { final long[] timestamps = Longs.toArray(longs); final long timestamp = Longs.max(timestamps); final long previousTimestamp = Longs.min(timestamps) - 1L; return Pair.of(previousTimestamp, timestamp); }
Longs.max(clientExecutionTimes), Ints.min(clientMixes), Ints.max(clientMixes));
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; return new Coder((int) Longs.max(frequencies.keySet().toLongArray()) + 1); } }
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; return new Coder(Fast.mostSignificantBit(Longs.max(frequencies.keySet().toLongArray()) + 1) * 2 + 1); } }
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; return new Coder(Fast.length(Longs.max(frequencies.keySet().toLongArray()))); } }