This repository was archived by the owner on Feb 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/clientapi/value Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,13 +45,19 @@ public interface INumberValue<T extends Number> extends IValue<T> {
4545 *
4646 * @param multiplier The incrementation multiplier
4747 */
48- void increment (float multiplier );
48+ @ SuppressWarnings ("unchecked" )
49+ default void increment (float multiplier ) {
50+ double range = getMaximum ().doubleValue () - getMinimum ().doubleValue ();
51+ this .setValue ((T ) (Number ) (this .getValue ().doubleValue () + (range / 10.0 * multiplier )));
52+ }
4953
5054 /**
5155 * Decrements the value of this {@link AbstractNumberType}
5256 * by {@code 1/10th} the range, multiplied by the parameter.
5357 *
5458 * @param multiplier The decrementation multiplier
5559 */
56- void decrement (float multiplier );
60+ default void decrement (float multiplier ) {
61+ this .increment (-multiplier );
62+ }
5763}
Original file line number Diff line number Diff line change @@ -76,16 +76,4 @@ public final T getMaximum() {
7676 public final T getInterval () {
7777 return this .interval ;
7878 }
79-
80- @ Override
81- @ SuppressWarnings ("unchecked" )
82- public final void increment (float multiplier ) {
83- double range = maximum .doubleValue () - minimum .doubleValue ();
84- this .setValue ((T ) (Number ) (this .getValue ().doubleValue () + (range / 10.0 * multiplier )));
85- }
86-
87- @ Override
88- public final void decrement (float multiplier ) {
89- this .increment (-multiplier );
90- }
9179}
You can’t perform that action at this time.
0 commit comments