public abstract class IntegerProperty extends ReadOnlyIntegerProperty implements Property<Number>, WritableIntegerValue
int値をラップするPropertyを定義します。
ObservableIntegerValue.get()、IntegerExpression.getValue()、WritableIntegerValue.set(int)およびsetValue(Number)を使用して、IntegerPropertyの値を取得および設定できます。
Property.bind(ObservableValue)およびProperty.unbind()を使用して、プロパティを一方向にバインドおよびバインド解除できます。 bindBidirectional(Property)およびunbindBidirectional(Property)を使用して、双方向バインディングを作成および削除できます。
ReadOnlyProperty.getBean()およびReadOnlyProperty.getName()を使用して、IntegerPropertyのコンテキストを読み取ることができます。
ノート: null値へのこのプロパティの設定またはバインドにより、プロパティが0.0に設定されます。 setValue(java.lang.Number)を参照してください。
ObservableIntegerValue、WritableIntegerValue、ReadOnlyIntegerProperty、Property| コンストラクタと説明 |
|---|
IntegerProperty() |
| 修飾子と型 | メソッドと説明 |
|---|---|
ObjectProperty<Integer> |
asObject()
この
IntegerPropertyに双方向にバインドされたObjectPropertyを作成します。 |
void |
bindBidirectional(Property<Number> other)
この
Propertyと別のPropertyの間の双方向バインディングを作成します。 |
static IntegerProperty |
integerProperty(Property<Integer> property)
Propertyをラップし、双方向にバインドされるIntegerPropertyを返します。 |
void |
setValue(Number v)
ラップされた値を設定します。
|
String |
toString()
この
IntegerPropertyオブジェクトの文字列表現を返します。 |
void |
unbindBidirectional(Property<Number> other)
この
Propertyと別のPropertyの間の双方向バインディングを削除します。 |
readOnlyIntegerPropertyadd, add, add, add, divide, divide, divide, divide, doubleValue, floatValue, getValue, integerExpression, integerExpression, intValue, longValue, multiply, multiply, multiply, multiply, negate, subtract, subtract, subtract, subtractadd, asString, asString, asString, divide, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, lessThan, lessThan, lessThan, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, multiply, numberExpression, subtractclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBean, getNameaddListener, getValue, removeListeneraddListener, removeListenerget, setgetValuegetpublic void setValue(Number v)
WritableIntegerValueのsetValueWritableValue<Number>のsetValuev - 新しい値public void bindBidirectional(Property<Number> other)
Propertyと別のPropertyの間の双方向バインディングを作成します。 双方向バインディングは、一方向バインディングと独立して存在します。 そのため、一方向バインディングを双方向バインディングを使用したプロパティに追加でき、その逆も可能です。 ただし、このプラクティスは推奨されていません。
1つのPropertyに複数の双方向バインディングを使用できます。
JavaFX双方向バインディング実装は、弱いリスナーを使用します。 これは、双方向バインディングによってプロパティがガベージ・コレクションされないことを意味します。
Property<Number>のbindBidirectionalother - 他のPropertypublic void unbindBidirectional(Property<Number> other)
Propertyと別のPropertyの間の双方向バインディングを削除します。 プロパティ間の双方向バインディングが存在しない場合、このメソッドの呼出しは影響しません。 2つ目のプロパティの呼出しによって、バインド解除できます。 このコードが動作します:
property1.bindBirectional(property2);
property2.unbindBidirectional(property1);
Property<Number>のunbindBidirectionalother - 他のPropertypublic String toString()
IntegerPropertyオブジェクトの文字列表現を返します。ReadOnlyIntegerPropertyのtoStringIntegerPropertyオブジェクトの文字列表現。public static IntegerProperty integerProperty(Property<Integer> property)
Propertyをラップし、双方向にバインドされるIntegerPropertyを返します。 このプロパティの変更により、元のプロパティが変更されます。
ObjectProperty
別の方法は、IntegerProperty integerProperty = new SimpleIntegerProperty(1); ObjectProperty<Integer> objectProperty = new SimpleObjectProperty<>(2); // Need to keep the reference as bidirectional binding uses weak references IntegerProperty objectAsInteger = IntegerProperty.integerProperty(objectProperty); integerProperty.bindBidirectional(objectAsInteger);
asObject()メソッドを使用してIntegerPropertyをObjectPropertyに変換することです。
ノート: ソース・プロパティのnull値は、0として解釈されます
property - ソースPropertyPropertyをラップするIntegerPropertyNullPointerException - propertyがnullの場合asObject()public ObjectProperty<Integer> asObject()
IntegerPropertyに双方向にバインドされたObjectPropertyを作成します。 このIntegerPropertyの値が変更されると、ObjectPropertyの値が自動的に更新され、その逆も同様です。
IntegerPropertyへのObjectPropertyのバインドに使用できます。
IntegerProperty integerProperty = new SimpleIntegerProperty(1); ObjectProperty<Integer> objectProperty = new SimpleObjectProperty<>(2); objectProperty.bind(integerProperty.asObject());
ReadOnlyIntegerPropertyのasObjectObjectPropertyCopyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.