Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between get() and GetValue() in DoublePropertyBase?

I had this listing and i can't see what is the porpouse:

DoubleProperty value = new DoublePropertyBase(0) {
        @Override protected void invalidated() {
            if (getValue() < get()) setValue(get());
        }
        @Override public String getName() { return "value"; }
    };

Is like getValue() is the new Value and get() is the old, but the documentation does not say that.

like image 792
multiplayer1080 Avatar asked Jun 04 '14 16:06

multiplayer1080


1 Answers

If you look at the source code of the superclass of DoubleProperty you can see that both methods return the same value. get() returns the primitive type double and getValue() a Double object.

javafx.beans.binding.DoubleExpression

@Override
public Double getValue() {
    return get();
}

javafx.beans.property.ReadOnlyDoubleProperty

@Override
public double get() {
    valid = true;
    final T value = property.getValue();
    return value == null ? 0.0 : value.doubleValue();
}
like image 55
Jens Avatar answered Oct 24 '22 10:10

Jens