FloatProperty


public abstract class FloatProperty
extends Property<T, Float>

java.lang.Object
   ↳ android.util.Property<T, java.lang.Float>
     ↳ android.util.FloatProperty<T>


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 constructors

FloatProperty(String name)

Public methods

final void set(T object, Float value)

Sets the value on object which 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 type float.

Inherited methods

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 the set() method should throw a NoSuchPropertyException exception).

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 class and name parameters, where the "name" parameter represents either:

  • a public getName() method on the class which takes no arguments, plus an optional public setName() method which takes a value of the same type returned by getName()
  • a public isName() method on the class which takes no arguments, plus an optional public setName() method which takes a value of the same type returned by isName()
  • a public name field on the class

If either of the get/is method alternatives is found on the class, but an appropriate setName() method is not found, the Property will be readOnly.

void set(T object, Float value)

Sets the value on object which this property represents.

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

Added in API level 24
public FloatProperty (String name)

Parameters
name String

Public methods

set

Added in API level 24
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

Added in API level 24
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