public abstract class IntegerPropertyBase extends IntegerProperty
IntegerPropertyBase
is the base class for a property
wrapping a int
value.
It provides all the functionality required for a property except for the
ReadOnlyProperty.getBean()
and ReadOnlyProperty.getName()
methods, which must be implemented
by extending classes.IntegerProperty
Modifier and Type | Class and Description |
---|---|
private static class |
IntegerPropertyBase.Listener |
private class |
IntegerPropertyBase.ValueWrapper |
Modifier and Type | Field and Description |
---|---|
private <any> |
helper |
private InvalidationListener |
listener |
private ObservableIntegerValue |
observable |
private boolean |
valid |
private int |
value |
Constructor and Description |
---|
IntegerPropertyBase()
The constructor of the
IntegerPropertyBase . |
IntegerPropertyBase(int initialValue)
The constructor of the
IntegerPropertyBase . |
Modifier and Type | Method and Description |
---|---|
void |
addListener(<any> listener) |
void |
addListener(InvalidationListener listener) |
void |
bind(<any> rawObservable)
Create a unidirection binding for this
Property . |
protected void |
fireValueChangedEvent()
Sends notifications to all attached
InvalidationListeners and
ChangeListeners . |
int |
get() |
protected void |
invalidated()
The method
invalidated() can be overridden to receive
invalidation notifications. |
boolean |
isBound()
Can be used to check, if a
Property is bound. |
private void |
markInvalid() |
void |
removeListener(<any> listener) |
void |
removeListener(InvalidationListener listener) |
void |
set(int newValue) |
java.lang.String |
toString()
Returns a string representation of this
IntegerPropertyBase object. |
void |
unbind()
Remove the unidirectional binding for this
Property . |
asObject, bindBidirectional, integerProperty, setValue, unbindBidirectional
readOnlyIntegerProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBean, getName
private int value
private ObservableIntegerValue observable
private InvalidationListener listener
private boolean valid
private <any> helper
public IntegerPropertyBase()
IntegerPropertyBase
.public IntegerPropertyBase(int initialValue)
IntegerPropertyBase
.initialValue
- the initial value of the wrapped valuepublic void addListener(InvalidationListener listener)
public void removeListener(InvalidationListener listener)
public void addListener(<any> listener)
public void removeListener(<any> listener)
protected void fireValueChangedEvent()
InvalidationListeners
and
ChangeListeners
.
This method is called when the value is changed, either manually by
calling set(int)
or in case of a bound property, if the
binding becomes invalid.private void markInvalid()
protected void invalidated()
invalidated()
can be overridden to receive
invalidation notifications. This is the preferred option in
Objects
defining the property, because it requires less memory.
The default implementation is empty.public int get()
public void set(int newValue)
public boolean isBound()
Property
is bound.true
if the Property
is bound, false
otherwise#bind(javafx.beans.value.ObservableValue)
public void bind(<any> rawObservable)
Property
.
Note that JavaFX has all the bind calls implemented through weak listeners. This means the bound property can be garbage collected and stopped from being updated.
rawObservable
- The observable this Property
should be bound to.public void unbind()
Property
.
If the Property
is not bound, calling this method has no effect.#bind(javafx.beans.value.ObservableValue)
public java.lang.String toString()
IntegerPropertyBase
object.toString
in class IntegerProperty
IntegerPropertyBase
object.