Class Power

  • All Implemented Interfaces:
    java.io.Serializable, Primitive, Unit, Filterable

    @Embeddable
    public class Power
    extends java.lang.Object
    implements java.io.Serializable, Filterable, Unit
    class storing both a Power and a unit for that Power (e.g. m, in, ly, etc.) encapsulated in a UnitsPower instance. As also described in the remoting definition (.ice) for Power, this is an embedded class meaning that the columns here do not appear in their own table but exist directly on the containing object. Like Details and Permissions, instances do not contain long identifiers and cannot be persisted on their own.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String UNIT  
      static java.lang.String VALUE  
    • Constructor Summary

      Constructors 
      Constructor Description
      Power()
      Deprecated.
      Power​(double d, java.lang.String u)  
      Power​(double d, UnitsPower u)  
      Power​(double d, ome.units.unit.Unit<ome.units.quantity.Power> unit)  
      Power​(ome.units.quantity.Power value)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean acceptFilter​(Filter filter)  
      static ome.units.quantity.Power convertPower​(Power t)
      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.
      static Power convertPower​(Power value, java.lang.String target)  
      static Power convertPower​(Power value, ome.units.unit.Unit<ome.units.quantity.Power> ul)  
      boolean equals​(java.lang.Object obj)  
      UnitsPower getUnit()
      Many-to-one field ome.model.units.Power.unit (ome.model.enums.UnitsPower).
      double getValue()
      value of this unit-field.
      int hashCode()  
      static ome.xml.model.enums.UnitsPower makePowerUnitXML​(java.lang.String unit)  
      static ome.units.quantity.Power makePowerXML​(double d, java.lang.String unit)  
      void setUnit​(UnitsPower unit)  
      void setValue​(double value)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Power

        @Deprecated
        public Power()
        Deprecated.
        no-arg constructor to keep Hibernate happy.
      • Power

        public Power​(double d,
                     java.lang.String u)
      • Power

        public Power​(double d,
                     UnitsPower u)
      • Power

        public Power​(double d,
                     ome.units.unit.Unit<ome.units.quantity.Power> unit)
      • Power

        public Power​(ome.units.quantity.Power value)
    • Method Detail

      • makePowerUnitXML

        public static ome.xml.model.enums.UnitsPower makePowerUnitXML​(java.lang.String unit)
      • makePowerXML

        public static ome.units.quantity.Power makePowerXML​(double d,
                                                            java.lang.String unit)
      • convertPower

        public static ome.units.quantity.Power convertPower​(Power t)
        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.
      • convertPower

        public static Power convertPower​(Power value,
                                         ome.units.unit.Unit<ome.units.quantity.Power> ul)
      • convertPower

        public static Power convertPower​(Power value,
                                         java.lang.String target)
      • getValue

        public double getValue()
        value of this unit-field. It will be persisted to a column with the same name as the containing field. For example, lightSource.getPower() which is of type Power will be stored in a column "lightSourcepower".
        Specified by:
        getValue in interface Unit
      • getUnit

        public UnitsPower getUnit()
        Many-to-one field ome.model.units.Power.unit (ome.model.enums.UnitsPower). These values are stored in a column suffixed by "Unit". Whereas value for physicalSizeX will be stored as "lightSource.power", the unit enum will be stored as "lightSource.powerUnit".
        Specified by:
        getUnit in interface Unit
      • setValue

        public void setValue​(double value)
        Specified by:
        setValue in interface Unit
      • setUnit

        public void setUnit​(UnitsPower unit)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object