public static MutableDouble fromExternal ( final DoubleSupplier s , final DoubleConsumer c ) { return new MutableDouble ( ) { @ Override public double getAsDouble ( ) { return s . getAsDouble ( ) ; } @ Override public Double get ( ) { return getAsDouble ( ) ; } @ Override public MutableDouble set ( final double value ) { c . accept ( value ) ; return this ; } } ; }
Construct a MutableDouble that gets and sets an external value using the provided Supplier and Consumer