Convert the given value expressed in the given unit to meters per second.

@param value is the value to convert
@param inputUnit is the unit of the {@code value}
@return the result of the convertion.
774115
@Pure
	public static double toMetersPerSecond(double value, SpeedUnit inputUnit) {
		switch (inputUnit) {
		case KILOMETERS_PER_HOUR:
			return 3.6 * value;
		case MILLIMETERS_PER_SECOND:
			return value / 1000.;
		case METERS_PER_SECOND:
		default:
		}
		return value;
	}
854506
private ValueUnitWrapper normalizeMassUnit(final double value, final String unit)
            throws UnknownUnitException {
        Matcher matcher = mMassUnitPatter.matcher(unit);
        if (matcher.find()) {

            double normalizationFactor = 1.0;

            String numeratorSIPrefix = matcher.group(1);
            Double numeratorFactor = getSIFactor(numeratorSIPrefix);
            if (numeratorFactor != null) {
                normalizationFactor *= numeratorFactor;
            }

            String denominatorSIPrefix = matcher.group(3);
            String denominatorUnit = matcher.group(4);
            Double denominatorFactor = getSIFactor(denominatorSIPrefix);
            if (denominatorFactor != null) {
                int power = (denominatorUnit.endsWith("3")) ? 3 : 1;
                normalizationFactor /= Math.pow(denominatorFactor, power);
            }

            if (denominatorUnit.equals("l") || denominatorUnit.equals("L")) {
                normalizationFactor *= 1000;
            }

            assert mSIPrefixes.get("kilo") != null : "kilo seems not to be in the table !";
            double normalizedValue = (normalizationFactor * value) / mSIPrefixes.get("kilo");
            return new ValueUnitWrapper(normalizedValue, MASS_NORMALIZED_UNIT);

        } else {
            throw new UnknownUnitException(unit);
        }
    }
1365603
public static final Rate parseRate(BigDecimal value)
   {
      Rate result = null;

      if (value != null)
      {
         result = new Rate(value, TimeUnit.HOURS);
      }

      return (result);
   }
457831
public static MachineTime<SI> of(
        long amount,
        SI unit
    ) {

        switch (unit) {
            case SECONDS:
                return ofSIUnits(amount, 0);
            case NANOSECONDS:
                long secs = Math.floorDiv(amount, MRD);
                int fraction = (int) Math.floorMod(amount, MRD);
                return ofSIUnits(secs, fraction);
            default:
                throw new UnsupportedOperationException(unit.name());
        }

    }
398396
function() {
      var v = inputEx.TimeIntervalField.superclass.getValue.call(this);
      return (parseInt(v[0],10)*v[1])/this.options.unit;
   }
663263
public static final Number parseUnits(Number value)
   {
      return (value == null ? null : NumberHelper.getDouble(value.doubleValue() * 100));
   }
406521
@Override
  public Decimal convert(Decimal value, String sourceUnit, String destUnit) throws UcumException  {
		assert value != null : paramError("convert", "value", "must not be null");
		assert checkStringParam(sourceUnit) : paramError("convert", "sourceUnit", "must not be null or empty");
		assert checkStringParam(destUnit) : paramError("convert", "destUnit", "must not be null or empty");

		if (sourceUnit.equals(destUnit))
			return value;
			
		Canonical src = new Converter(model, handlers).convert(new ExpressionParser(model).parse(sourceUnit));
		Canonical dst = new Converter(model, handlers).convert(new ExpressionParser(model).parse(destUnit));
		String s = new ExpressionComposer().compose(src, false);
		String d = new ExpressionComposer().compose(dst, false);
		if (!s.equals(d))
			throw new UcumException("Unable to convert between units "+sourceUnit+" and "+destUnit+" as they do not have matching canonical forms ("+s+" and "+d+" respectively)");
		Decimal canValue = value.multiply(src.getValue());
//		System.out.println(value.toPlainString()+sourceUnit+" =("+src.getValue().toPlainString()+")= "+
//				canValue.toPlainString()+s+" =("+dst.getValue().toPlainString()+")= "+
//				canValue.divide(dst.getValue())+destUnit);
		return canValue.divide(dst.getValue());
	}
922078
protected Float convertFloat(String value, String unit, int unary)
			throws IllegalArgumentException {

		try {
            if (unit != null)
            {
    			// trim & lowercase
    			value = value.trim().toLowerCase();
    			// trim units from value
                if (value.endsWith(unit))
                    value = value.substring(0, value.length() - unit.length());
            }

			return Float.parseFloat(value) * unary;
		} catch (NumberFormatException e) {
			throw new IllegalArgumentException(
					"Invalid number format " + value, e);
		} catch (NullPointerException e) {
			throw new IllegalArgumentException("Invalid null format");
		}
	}
1259646
public static int unitsToSeconds(String interval, String unit) {
       if (interval == null || interval.isEmpty()) return 0;
       else if (unit == null) return (int)(Double.parseDouble(interval));
       else if (unit.equals(INTERVAL_DAYS)) return (int)(Double.parseDouble(interval)*86400);
       else if (unit.equals(INTERVAL_HOURS)) return (int)(Double.parseDouble(interval)*3600);
       else if (unit.equals(INTERVAL_MINUTES)) return (int)(Double.parseDouble(interval)*60);
       else return (int)(Double.parseDouble(interval));
   }
193430
public static final BigInteger printTimeUnit(TimeUnit value)
   {
      return (BigInteger.valueOf(value == null ? TimeUnit.DAYS.getValue() + 1 : value.getValue() + 1));
   }
1202844
public static void push(String metric, int interval, Object value) {
        SingleRxXian.call("monitor", "pushToFalcon", new JSONObject() {{
            put("metric", metric);
            put("step", interval);
            put("value", value);
        }}).subscribe(unitResponse -> LOG.info("监控数据推送完毕:" + unitResponse));
    }
1125136
@Pure
	public static double fromRadiansPerSecond(double value, AngularUnit outputUnit) {
		switch (outputUnit) {
		case TURNS_PER_SECOND:
			return value / (2. * MathConstants.PI);
		case DEGREES_PER_SECOND:
			return Math.toDegrees(value);
		case RADIANS_PER_SECOND:
		default:
		}
		return value;
	}
78098
@CheckForNull
    public static TimeDuration fromString(@CheckForNull String delay) {
        if (delay == null) {
            return null;
        }

        long unitMultiplier = 1L;
        delay = delay.trim();
        try {
            // TODO: more unit handling
            if (delay.endsWith("sec") || delay.endsWith("secs")) {
                delay = delay.substring(0, delay.lastIndexOf("sec"));
                delay = delay.trim();
                unitMultiplier = 1000L;
            }
            return new TimeDuration(Long.parseLong(delay.trim()) * unitMultiplier);
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("Invalid time duration value: "+delay);
        }
    }
814408
public final Latency withMedian(double value) {
    double newValue = value;
    return new Latency(
        newValue,
        this.percentile98th,
        this.percentile99th,
        this.percentile999th,
        this.mean,
        this.min,
        this.max);
  }
16671
@Override
  public UnitValue convert(UnitValue value) {
    Unit src = value.unit();
    switch (src.category()) {
      case CONCENTR:
      case LIGHT:
        // Not available
        break;
        
      case ACCELERATION:
        return convert(value, Unit.METER_PER_SECOND_SQUARED, UnitFactors.ACCELERATION);
      case ANGLE:
        return convert(value, UnitFactorSets.ANGLE);
      case AREA:
        return convert(value, areaFactors());
      case CONSUMPTION:
        return convert(value, consumptionUnit());
      case DIGITAL:
        return convert(value, UnitFactorSets.DIGITAL_BYTES);
      case DURATION:
        return convert(value, UnitFactorSets.DURATION);
      case ELECTRIC:
        return convert(value, UnitFactorSets.ELECTRIC);
      case ENERGY:
        return convert(value, energyFactors());
      case FREQUENCY:
        return convert(value, UnitFactorSets.FREQUENCY);
      case LENGTH:
        return convert(value, lengthFactors());
      case MASS:
        return convert(value, massFactors());
      case POWER:
        return convert(value, UnitFactorSets.POWER);
      case PRESSURE:
        return convert(value, Unit.MILLIBAR);
      case SPEED:
        return convert(value, speedUnit());
      case TEMPERATURE:
        return convert(value, temperatureUnit());
      case VOLUME:
        return convert(value, volumeFactors());
    }
    
    return value;
  }
834265
public static long timeUnitToMillis(long value,
                                        TimeUnit unit,
                                        boolean annotation,
                                        BeanMetaData bmd) throws EJBConfigurationException {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(tc, "timeUnitToMillis: " + value + unit);
        }

        // Initialize to input value in case current unit is already in
        // javax.util.concurrent.TimeUnit.MILLISECONDS
        long timeout = value;

        if (timeout > 0) {

            timeout = TimeUnit.MILLISECONDS.convert(value, unit);
            if (timeout == Long.MAX_VALUE || timeout == Long.MIN_VALUE) {
                Tr.error(tc, "STATEFUL_TIMEOUT_OVERFLOW_CNTR0309E",
                         new Object[] { bmd.getName(), bmd.getModuleMetaData().getName(),
                                       bmd.getModuleMetaData().getApplicationMetaData().getName(),
                                       value, unit });
                throw new EJBConfigurationException("Conversion of stateful session timeout value of " +
                                                    value + " " + unit + " to milliseconds resulted in overflow.");
            }

        }
        else {
            if (timeout == 0) {
                // 0 means no wait, represented internally as the nominal 1 millisecond
                timeout = 1;
            }
            else if (timeout == -1) {
                // -1 indicates wait forever, represented internally as 0
                timeout = 0L;
            }
            else {

                // invalid (negative) timeout value
                Object[] parms = new Object[] { bmd.getName(), bmd.getModuleMetaData().getName(), bmd.getModuleMetaData().getApplicationMetaData().getName(), timeout };
                if (annotation) {
                    Tr.error(tc, "NEGATIVE_STATEFUL_TIMEOUT_ANN_CNTR0311E", parms);
                }
                else {
                    Tr.error(tc, "NEGATIVE_STATEFUL_TIMEOUT_XML_CNTR0312E", parms);
                }

                throw new EJBConfigurationException("Stateful session timeout value of " +
                                                    value + " " + unit + " is negative.");

            }
        }

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.exit(tc, "timeUnitToMillis: " + timeout);
        }

        return timeout;
    }
838379
public long getDomMinLoadTime(final String intervalName, final TimeUnit unit) {
		final long min = domMinLoadTime.getValueAsLong(intervalName);
		return min == Constants.MIN_TIME_DEFAULT ? min : unit.transformMillis(min);
	}