< prev index next >

modules/base/src/main/java/javafx/beans/binding/DoubleBinding.java

Print this page




  73  *
  74  * Following is the same example with implementations for the optional methods
  75  * {@link Binding#getDependencies()} and {@link Binding#dispose()}.
  76  *
  77  * <pre>
  78  * <code>
  79  * final ObservableDoubleValue moo = ...;
  80  *
  81  * DoubleBinding foo = new DoubleBinding() {
  82  *
  83  *     {
  84  *         super.bind(moo);
  85  *     }
  86  *
  87  *     @Override
  88  *     protected double computeValue() {
  89  *         return Math.sqrt(moo.getValue());
  90  *     }
  91  *
  92  *     @Override
  93  *     public ObservableList<?> getDependencies() {
  94  *         return FXCollections.singletonObservableList(moo);
  95  *     }
  96  *
  97  *     @Override
  98  *     public void dispose() {
  99  *         super.unbind(moo);
 100  *     }
 101  * };
 102  * </code>
 103  * </pre>
 104  *
 105  * @see Binding
 106  * @see NumberBinding
 107  * @see javafx.beans.binding.DoubleExpression
 108  *
 109  *
 110  * @since JavaFX 2.0
 111  */
 112 public abstract class DoubleBinding extends DoubleExpression implements
 113         NumberBinding {




  73  *
  74  * Following is the same example with implementations for the optional methods
  75  * {@link Binding#getDependencies()} and {@link Binding#dispose()}.
  76  *
  77  * <pre>
  78  * <code>
  79  * final ObservableDoubleValue moo = ...;
  80  *
  81  * DoubleBinding foo = new DoubleBinding() {
  82  *
  83  *     {
  84  *         super.bind(moo);
  85  *     }
  86  *
  87  *     @Override
  88  *     protected double computeValue() {
  89  *         return Math.sqrt(moo.getValue());
  90  *     }
  91  *
  92  *     @Override
  93  *     public ObservableList&lt;?&gt; getDependencies() {
  94  *         return FXCollections.singletonObservableList(moo);
  95  *     }
  96  *
  97  *     @Override
  98  *     public void dispose() {
  99  *         super.unbind(moo);
 100  *     }
 101  * };
 102  * </code>
 103  * </pre>
 104  *
 105  * @see Binding
 106  * @see NumberBinding
 107  * @see javafx.beans.binding.DoubleExpression
 108  *
 109  *
 110  * @since JavaFX 2.0
 111  */
 112 public abstract class DoubleBinding extends DoubleExpression implements
 113         NumberBinding {


< prev index next >