Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
  
  
FloatProperty
  public
  
  
  abstract
  class
  FloatProperty
  
  
  
  
    extends Property<T, Float>
  
  
  
  
  
  
  
    
  An implementation of Property to be used specifically with fields of type
 float. This type-specific subclass enables performance benefit by allowing
 calls to a setValue() function that takes the primitive
 float type and avoids autoboxing and other overhead associated with the
 Float class.
Summary
| Public methods | 
|---|
  
  
  
    | 
        
        
        
        final
        
        void | 
      set(T object, Float value)
      Sets the value on objectwhich this property represents. | 
  
  
  
  
    | 
        abstract
        
        
        
        
        void | 
      setValue(T object, float value)
      A type-specific variant of set(java.lang.Object, java.lang.Float)that is faster when dealing
 with fields of typefloat. | 
  
| Inherited methods | 
|---|
| 
    From class
      
        
          android.util.Property
        
      
      
  
  
  
    | 
        abstract
        
        
        
        
        Float | 
      get(T object)
      Returns the current value that this property represents on the given object. |  
  
  
    | 
        
        
        
        
        
        String | 
      getName()
      Returns the name for this property.
        
    
 |  
  
  
    | 
        
        
        
        
        
        Class<Float> | 
      getType()
      Returns the type for this property.
        
    
 |  
  
  
    | 
        
        
        
        
        
        boolean | 
      isReadOnly()
      Returns true if the set(java.lang.Object, java.lang.Object)method does not set the value on the target
 object (in which case theset()method should throw aNoSuchPropertyExceptionexception). |  
  
  
    | 
        
        
        static
        
        <T, V>
        Property<T, Float> | 
      of(Class<T> hostType, Class<Float> valueType, String name)
      This factory method creates and returns a Property given the classandnameparameters, where the"name"parameter represents either: 
     a public getName()method on the class which takes no arguments, plus an
     optional publicsetName()method which takes a value of the same type
     returned bygetName()a public isName()method on the class which takes no arguments, plus an
     optional publicsetName()method which takes a value of the same type
     returned byisName()a public namefield on the class If either of the get/is method alternatives is found on the class, but an appropriate
 setName()method is not found, thePropertywill bereadOnly. |  
  
  
    | 
        
        
        
        
        
        void | 
      set(T object, Float value)
      Sets the value on objectwhich this property represents. |  | 
| 
    From class
      
        
          java.lang.Object
        
      
      
  
  
  
    | 
        
        
        
        
        
        Object | 
      clone()
      Creates and returns a copy of this object.
        
    
 |  
  
  
    | 
        
        
        
        
        
        boolean | 
      equals(Object obj)
      Indicates whether some other object is "equal to" this one.
        
    
 |  
  
  
    | 
        
        
        
        
        
        void | 
      finalize()
      Called by the garbage collector on an object when garbage collection
 determines that there are no more references to the object.
        
    
 |  
  
  
    | 
        
        
        
        final
        
        Class<?> | 
      getClass()
      Returns the runtime class of this Object. |  
  
  
    | 
        
        
        
        
        
        int | 
      hashCode()
      Returns a hash code value for the object.
        
    
 |  
  
  
    | 
        
        
        
        final
        
        void | 
      notify()
      Wakes up a single thread that is waiting on this object's
 monitor.
        
    
 |  
  
  
    | 
        
        
        
        final
        
        void | 
      notifyAll()
      Wakes up all threads that are waiting on this object's monitor.
        
    
 |  
  
  
    | 
        
        
        
        
        
        String | 
      toString()
      Returns a string representation of the object.
        
    
 |  
  
  
    | 
        
        
        
        final
        
        void | 
      wait(long timeoutMillis, int nanos)
      Causes the current thread to wait until it is awakened, typically
 by being notified or interrupted, or until a
 certain amount of real time has elapsed.
        
    
 |  
  
  
    | 
        
        
        
        final
        
        void | 
      wait(long timeoutMillis)
      Causes the current thread to wait until it is awakened, typically
 by being notified or interrupted, or until a
 certain amount of real time has elapsed.
        
    
 |  
  
  
    | 
        
        
        
        final
        
        void | 
      wait()
      Causes the current thread to wait until it is awakened, typically
 by being notified or interrupted.
        
    
 |  | 
Public constructors
    FloatProperty
    
public FloatProperty (String name)
    
    
    
  
    
 
Public methods
    set
    
public final void set (T object, 
                Float value)
    
    
    
  Sets the value on object which this property represents. If the method is unable
 to set the value on the target object it will throw an UnsupportedOperationException
 exception.
    
    | Parameters | 
|---|
      
        | object | T | 
      
        | value | Float | 
    
 
    setValue
    
public abstract void setValue (T object, 
                float value)
    
    
    
  A type-specific variant of set(java.lang.Object, java.lang.Float) that is faster when dealing
 with fields of type float.
    
    | Parameters | 
|---|
      
        | object | T | 
      
        | value | float | 
    
 
 
 
  
  
    
  
 
  
    
    
      
       
    
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2025-02-10 UTC.
  
  
  
    
      [null,null,["Last updated 2025-02-10 UTC."],[],[]]