public static Pressure createPressure(Integer value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value, valueUnit); }
public static Pressure createPressure(Integer value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value, valueUnit); }
public static Pressure createPressure(Double value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value, valueUnit); }
public static Pressure createPressure(Double value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value, valueUnit); }
public static <T extends PrimitiveNumber> Pressure createPressure(T value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value.getNumberValue(), valueUnit); }
public static <T extends PrimitiveNumber> Pressure createPressure(T value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value.getNumberValue(), valueUnit); }
public static <T extends Number> Pressure getQuantity(T inValue, UnitsPressure inModelUnit) throws EnumerationException { if (inValue instanceof Double) { Double doubleValue = (Double) inValue; return new ome.units.quantity.Pressure(doubleValue, getBaseUnit(inModelUnit)); } if (inValue instanceof Integer) { Integer intValue = (Integer) inValue; return new ome.units.quantity.Pressure(intValue, getBaseUnit(inModelUnit)); } LOGGER.warn("Unknown type '{}' cannot be used to create a 'Pressure' quantity", inValue.getClass().getName()); throw new EnumerationException("UnitsPressureEnumHandler: type '" + inValue.getClass().getName() + "' cannot be used to create a quantity"); }
public static <T extends Number> Pressure getQuantity(T inValue, UnitsPressure inModelUnit) throws EnumerationException { if (inValue instanceof Double) { Double doubleValue = (Double) inValue; return new ome.units.quantity.Pressure(doubleValue, getBaseUnit(inModelUnit)); } if (inValue instanceof Integer) { Integer intValue = (Integer) inValue; return new ome.units.quantity.Pressure(intValue, getBaseUnit(inModelUnit)); } LOGGER.warn("Unknown type '{}' cannot be used to create a 'Pressure' quantity", inValue.getClass().getName()); throw new EnumerationException("UnitsPressureEnumHandler: type '" + inValue.getClass().getName() + "' cannot be used to create a quantity"); }
public static ome.units.quantity.Pressure makeXMLQuantity(double d, String unit) { ome.units.unit.Unit<ome.units.quantity.Pressure> units = ome.xml.model.enums.handlers.UnitsPressureEnumHandler .getBaseUnit(makeXMLUnit(unit)); return new ome.units.quantity.Pressure(d, units); }
public static ome.units.quantity.Pressure makePressureXML(double d, String unit) { ome.units.unit.Unit<ome.units.quantity.Pressure> units = ome.xml.model.enums.handlers.UnitsPressureEnumHandler .getBaseUnit(makePressureUnitXML(unit)); return new ome.units.quantity.Pressure(d, units); }
return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit));
/** * FIXME: this should likely take a default so that locations which don't * want an exception can have * * log.warn("Using new PositiveFloat(1.0)!", e); return new * PositiveFloat(1.0); * * or similar. */ public static ome.units.quantity.Pressure convertPressure(Pressure t) { if (t == null) { return null; } Double v = t.getValue(); String u = t.getUnit().getSymbol(); ome.xml.model.enums.UnitsPressure units = makePressureUnitXML(u); ome.units.unit.Unit<ome.units.quantity.Pressure> units2 = ome.xml.model.enums.handlers.UnitsPressureEnumHandler .getBaseUnit(units); return new ome.units.quantity.Pressure(v, units2); }
/** * Creates a imaging environment. * * @return See above. */ public ImagingEnvironment createImageEnvironment() { ImagingEnvironment env = new ImagingEnvironment(); env.setAirPressure(new Pressure(1.0, UNITS.MILLIBAR)); env.setCO2Percent(new PercentFraction(1.0f)); env.setHumidity(new PercentFraction(1.0f)); env.setTemperature(new Temperature(1.0, UNITS.CELSIUS)); return env; }
new Pressure(new Double(airPressure), UNITS.MILLIBAR), i);
new Pressure(new Double(airPressure), UNITS.MILLIBAR), i);
/** * FIXME: this should likely take a default so that locations which don't * want an exception can have * * log.warn("Using new PositiveFloat(1.0)!", e); return new * PositiveFloat(1.0); * * or similar. */ public static ome.units.quantity.Pressure convert(Pressure t) { if (t == null) { return null; } Double v = t.getValue(); // Use the code/symbol-mapping in the ome.model.enums files // to convert to the specification value. String u = ome.model.enums.UnitsPressure.valueOf( t.getUnit().toString()).getSymbol(); ome.xml.model.enums.UnitsPressure units = makeXMLUnit(u); ome.units.unit.Unit<ome.units.quantity.Pressure> units2 = ome.xml.model.enums.handlers.UnitsPressureEnumHandler .getBaseUnit(units); return new ome.units.quantity.Pressure(v, units2); }