Stay organized with collections Save and categorize content based on your preferences.
IntProperty
public abstract class IntProperty
extends Property<T, Integer>
An implementation of Property
to be used specifically with fields of type int
. This type-specific subclass enables performance benefit by allowing calls to a setValue()
function that takes the primitive int
type and avoids autoboxing and other overhead associated with the Integer
class.
Summary
Inherited methods |
From class android.util.Property abstract Integer | get(T object) Returns the current value that this property represents on the given object . | String | getName() Returns the name for this property. | Class<Integer> | 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, Integer> | of(Class<T> hostType, Class<Integer> 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, Integer value) Sets the value on object which 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
IntProperty
public IntProperty (String name)
Public methods
set
public final void set (T object, Integer 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 | Integer |
setValue
public abstract void setValue (T object, int value)
A type-specific variant of set(java.lang.Object, java.lang.Integer)
that is faster when dealing with fields of type int
.
Parameters |
object | T |
value | int |
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]