Claim up to the supplied number of positions.

@param number the maximum number of positions to claim for writing; must be positive
@return the highest position that were claimed
764809
protected long claimUpTo( int number ) {
        assert number > 0;
        long nextPosition = this.nextPosition;
        long maxPosition = nextPosition + number;
        long wrapPoint = maxPosition - bufferSize;
        long cachedSlowestConsumerPosition = this.slowestConsumerPosition;

        if (wrapPoint > cachedSlowestConsumerPosition || cachedSlowestConsumerPosition > nextPosition) {
            long minPosition;
            while (wrapPoint > (minPosition = positionOfSlowestPointer(nextPosition))) {
                // This takes on the order of tens of nanoseconds, so it's a useful activity to pause a bit.
                LockSupport.parkNanos(1L);
                waitStrategy.signalAllWhenBlocking();
            }
            this.slowestConsumerPosition = minPosition;
        }

        this.nextPosition = maxPosition;
        return maxPosition;

    }
1111312
private void setNumbers(int number, ArrayList numbers) {
        this.numbers = new ArrayList();
        this.numbers.add(Integer.valueOf(number));
        this.numbers.addAll(numbers);
    }
918407
public static <N extends Number> Number max(List<N> numberList) {
        return cal(numberList, DoubleStream::max);
    }
1314545
function eifelerRegelAppliesToNumber(number) {
    number = parseInt(number, 10);
    if (isNaN(number)) {
        return false;
    }
    if (number < 0) {
        // Negative Number --> always true
        return true;
    } else if (number < 10) {
        // Only 1 digit
        if (4 <= number && number <= 7) {
            return true;
        }
        return false;
    } else if (number < 100) {
        // 2 digits
        var lastDigit = number % 10, firstDigit = number / 10;
        if (lastDigit === 0) {
            return eifelerRegelAppliesToNumber(firstDigit);
        }
        return eifelerRegelAppliesToNumber(lastDigit);
    } else if (number < 10000) {
        // 3 or 4 digits --> recursively check first digit
        while (number >= 10) {
            number = number / 10;
        }
        return eifelerRegelAppliesToNumber(number);
    } else {
        // Anything larger than 4 digits: recursively check first n-3 digits
        number = number / 1000;
        return eifelerRegelAppliesToNumber(number);
    }
}
143660
@NullSafe
  public static int sum(final int... numbers) {
    int sum = 0;

    if (numbers != null) {
      for (int number : numbers) {
        sum += number;
      }
    }

    return sum;
  }
582143
public long getCurrentValue(int nth) {
    long v = min.getCurrent(nth).get();
    return (v == Long.MAX_VALUE) ? 0L : v;
  }
612883
public static <N extends Number> int getRHD(N number) {
                String numberAsString = String.valueOf(number);
                return numberAsString.substring(numberAsString.lastIndexOf('.') + 1).length();
        }
89454
public final int needArgumentsNumber() {
    int number = 0;
    for (int i : needArgument) {
      number = Math.max(number, (i + 1));
    }
    return number;
  }
367657
public String encode(long... numbers) {
        if (numbers.length == 0) {
            return "";
        }

        for (final long number : numbers) {
            if (number < 0) {
                return "";
            }
            if (number > MAX_NUMBER) {
                throw new IllegalArgumentException("number can not be greater than " + MAX_NUMBER + "L");
            }
        }
        return this._encode(numbers);
    }
1196325
public int maxValue()
    {
        final int initialValue = this.initialValue;
        int max = size == 0 ? initialValue : Integer.MIN_VALUE;

        final int[] entries = this.entries;
        @DoNotSub final int length = entries.length;

        for (@DoNotSub int i = 1; i < length; i += 2)
        {
            final int value = entries[i];
            if (value != initialValue)
            {
                max = Math.max(max, value);
            }
        }

        return max;
    }
954995
public boolean contains(Integer sheet, int number)
    {
        for (final TileRef current : tiles)
        {
            if (current.getSheet().equals(sheet) && current.getNumber() == number)
            {
                return true;
            }
        }
        return false;
    }
981716
public static function limit($number, $min, $max): int
    {
        return self::max(self::min($number, $min), $max);
    }
1097480
public int getMaxEndPosition(int docId, int position) throws IOException {
    if (ignoreSpans != null && docId == currentDocId) {
      if (position < minimumPosition) {
        throw new IOException(
            "Unexpected position, should be >= " + minimumPosition + "!");
      }
      computeFullEndPositionList(position);
      if (maxFullEndPosition.containsKey(position)) {
        return maxFullEndPosition.get(position);
      } else {
        return 0;
      }
    } else {
      return 0;
    }
  }
1003277
private int incrementReferenceCounter(final JobID jobID) {

		while (true) {

			AtomicInteger ai = this.libraryReferenceCounter.get(jobID);
			if (ai == null) {

				ai = new AtomicInteger(1);
				if (this.libraryReferenceCounter.putIfAbsent(jobID, ai) == null) {
					return 1;
				}

				// We had a race, try again
			} else {
				return ai.incrementAndGet();
			}
		}
	}
55215
public void setNumber(String number) {
        try {
            String iso = null;
            if (mSelectedCountry != null) {
                iso = mSelectedCountry.getIso();
            }
            Phonenumber.PhoneNumber phoneNumber = mPhoneUtil.parse(number, iso);
			
            int countryIdx = mCountries.indexOfIso(mPhoneUtil.getRegionCodeForNumber(phoneNumber));
			mSelectedCountry = mCountries.get(countryIdx);		
            mCountrySpinner.setSelection(countryIdx);
			
			
            mPhoneEdit.setText(mPhoneUtil.format(phoneNumber, PhoneNumberUtil.PhoneNumberFormat.NATIONAL));
        } catch (NumberParseException ignored) {
        }
    }
1306115
public static PactDslRootValue numberType(Number number) {
    PactDslRootValue value = new PactDslRootValue();
    value.setValue(number);
    value.setMatcher(TypeMatcher.INSTANCE);
    return value;
  }
131158
protected int checkWrite(int offset, int length) {
    checkOffset(offset);
    if (limit == -1) {
      if (offset + length > capacity) {
        if (capacity < maxCapacity) {
          capacity(calculateCapacity(offset + length));
        } else {
          throw new BufferOverflowException();
        }
      }
    } else {
      if (offset + length > limit) {
        throw new BufferOverflowException();
      }
    }
    return offset(offset);
  }