public static Pressure createPressure(Integer value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value, valueUnit); }
public Enumeration getEnumeration(Pressure inUnit) throws EnumerationException { return getEnumeration(inUnit.unit().getSymbol()); }
/** * Check quantities for equality. * * Unit conversion will be performed when required to convert into * the unit system of this quantity in order to perform the * comparison. * * Note that floating point comparison is dangerous. Do not use * this method. * * @return true if equal, false if not equal. */ @Override public int compareTo(Pressure other) { if (this == other) { return 0; } return Double.compare(value.doubleValue(), other.value(unit).doubleValue()); }
public Enumeration getEnumeration(Pressure inUnit) throws EnumerationException { return getEnumeration(inUnit.unit().getSymbol()); }
/** * Check quantities for equality. * * Unit conversion will be performed when required to convert into * the unit system of this quantity in order to perform the * comparison. * * Note that floating point comparison is dangerous. Do not use * this method. * * @return true if equal, false if not equal. */ @Override public int compareTo(Pressure other) { if (this == other) { return 0; } return Double.compare(value.doubleValue(), other.value(unit).doubleValue()); }
public static Pressure createPressure(Integer value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value, valueUnit); }
/** * Convert a Bio-Formats {@link Pressure} to an OMERO Pressure. A null will be * returned if the input is null. */ public static Pressure convertPressure(ome.units.quantity.Pressure value) { if (value == null) return null; String internal = xmlPressureEnumToOMERO(value.unit().getSymbol()); UnitsPressure ul = UnitsPressure.valueOf(internal); return new omero.model.PressureI(value.value().doubleValue(), ul); }
public static Pressure createPressure(Double value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value, valueUnit); }
/** * Convert a Bio-Formats {@link Length} to an OMERO Length. */ public PressureI(ome.units.quantity.Pressure value) { ome.model.enums.UnitsPressure internal = ome.model.enums.UnitsPressure.bySymbol(value.unit().getSymbol()); UnitsPressure ul = UnitsPressure.valueOf(internal.toString()); setValue(value.value().doubleValue()); setUnit(ul); }
public static Pressure createPressure(Double value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value, valueUnit); }
if (airPressure.value() != null) ImagingEnvironment_element.setAttribute("AirPressure", airPressure.value().toString()); if (airPressure.unit() != null) UnitsPressure enumUnits = UnitsPressure.fromString(airPressure.unit().getSymbol()); ImagingEnvironment_element.setAttribute("AirPressureUnit", enumUnits.toString()); } catch (EnumerationException e)
public static <T extends PrimitiveNumber> Pressure createPressure(T value, Unit<Pressure> valueUnit) { if (value == null) { return null; } return new Pressure(value.getNumberValue(), valueUnit); }
if (airPressure.value() != null) ImagingEnvironment_element.setAttribute("AirPressure", airPressure.value().toString()); if (airPressure.unit() != null) UnitsPressure enumUnits = UnitsPressure.fromString(airPressure.unit().getSymbol()); ImagingEnvironment_element.setAttribute("AirPressureUnit", enumUnits.toString()); } catch (EnumerationException e)
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));