-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,108 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
mmm-util-property/src/main/java/net/sf/mmm/util/property/api/IntegerProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 | ||
* http://www.apache.org/licenses/LICENSE-2.0 */ | ||
package net.sf.mmm.util.property.api; | ||
|
||
import javafx.beans.binding.Bindings; | ||
import javafx.beans.binding.FloatBinding; | ||
import javafx.beans.binding.IntegerBinding; | ||
import javafx.beans.binding.LongBinding; | ||
import javafx.beans.value.ObservableIntegerValue; | ||
import javafx.beans.value.WritableIntegerValue; | ||
|
||
/** | ||
* This is the interface for a {@link GenericProperty} of the {@link #getValue() value}-{@link #getType() type} | ||
* {@link Integer}. | ||
* | ||
* @author hohwille | ||
* @since 7.1.0 | ||
*/ | ||
public interface IntegerProperty extends NumberProperty, ObservableIntegerValue, WritableIntegerValue { | ||
|
||
@Override | ||
default int get() { | ||
|
||
Number value = getValue(); | ||
if (value == null) { | ||
return 0; | ||
} | ||
return value.intValue(); | ||
} | ||
|
||
@Override | ||
default void set(int value) { | ||
|
||
setValue(Integer.valueOf(value)); | ||
} | ||
|
||
@Override | ||
default IntegerBinding negate() { | ||
|
||
return (IntegerBinding) Bindings.negate(this); | ||
} | ||
|
||
@Override | ||
default FloatBinding add(float other) { | ||
|
||
return (FloatBinding) Bindings.add(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding add(long other) { | ||
|
||
return (LongBinding) Bindings.add(this, other); | ||
} | ||
|
||
@Override | ||
default IntegerBinding add(int other) { | ||
|
||
return (IntegerBinding) Bindings.add(this, other); | ||
} | ||
|
||
@Override | ||
default FloatBinding subtract(float other) { | ||
|
||
return (FloatBinding) Bindings.subtract(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding subtract(long other) { | ||
|
||
return (LongBinding) Bindings.subtract(this, other); | ||
} | ||
|
||
@Override | ||
default IntegerBinding subtract(int other) { | ||
|
||
return (IntegerBinding) Bindings.subtract(this, other); | ||
} | ||
|
||
@Override | ||
default FloatBinding multiply(float other) { | ||
|
||
return (FloatBinding) Bindings.multiply(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding multiply(long other) { | ||
|
||
return (LongBinding) Bindings.multiply(this, other); | ||
} | ||
|
||
@Override | ||
default IntegerBinding multiply(int other) { | ||
|
||
return (IntegerBinding) Bindings.multiply(this, other); | ||
} | ||
|
||
@Override | ||
default FloatBinding divide(float other) { | ||
|
||
return (FloatBinding) Bindings.divide(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding divide(long other) { | ||
|
||
return (LongBinding) Bindings.divide(this, other); | ||
} | ||
|
||
@Override | ||
default IntegerBinding divide(int other) { | ||
|
||
return (IntegerBinding) Bindings.divide(this, other); | ||
} | ||
|
||
} |
114 changes: 114 additions & 0 deletions
114
mmm-util-property/src/main/java/net/sf/mmm/util/property/api/LongProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 | ||
* http://www.apache.org/licenses/LICENSE-2.0 */ | ||
package net.sf.mmm.util.property.api; | ||
|
||
import javafx.beans.binding.Bindings; | ||
import javafx.beans.binding.FloatBinding; | ||
import javafx.beans.binding.LongBinding; | ||
import javafx.beans.value.ObservableLongValue; | ||
import javafx.beans.value.WritableLongValue; | ||
|
||
/** | ||
* This is the interface for a {@link GenericProperty} of the {@link #getValue() value}-{@link #getType() type} | ||
* {@link Integer}. | ||
* | ||
* @author hohwille | ||
* @since 7.1.0 | ||
*/ | ||
public interface LongProperty extends NumberProperty, ObservableLongValue, WritableLongValue { | ||
|
||
@Override | ||
default long get() { | ||
|
||
Number value = getValue(); | ||
if (value == null) { | ||
return 0; | ||
} | ||
return value.longValue(); | ||
} | ||
|
||
@Override | ||
default void set(long value) { | ||
|
||
setValue(Long.valueOf(value)); | ||
} | ||
|
||
@Override | ||
default LongBinding negate() { | ||
|
||
return (LongBinding) Bindings.negate(this); | ||
} | ||
|
||
@Override | ||
default FloatBinding add(float other) { | ||
|
||
return (FloatBinding) Bindings.add(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding add(long other) { | ||
|
||
return (LongBinding) Bindings.add(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding add(int other) { | ||
|
||
return (LongBinding) Bindings.add(this, other); | ||
} | ||
|
||
@Override | ||
default FloatBinding subtract(float other) { | ||
|
||
return (FloatBinding) Bindings.subtract(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding subtract(long other) { | ||
|
||
return (LongBinding) Bindings.subtract(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding subtract(int other) { | ||
|
||
return (LongBinding) Bindings.subtract(this, other); | ||
} | ||
|
||
@Override | ||
default FloatBinding multiply(float other) { | ||
|
||
return (FloatBinding) Bindings.multiply(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding multiply(long other) { | ||
|
||
return (LongBinding) Bindings.multiply(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding multiply(int other) { | ||
|
||
return (LongBinding) Bindings.multiply(this, other); | ||
} | ||
|
||
@Override | ||
default FloatBinding divide(float other) { | ||
|
||
return (FloatBinding) Bindings.divide(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding divide(long other) { | ||
|
||
return (LongBinding) Bindings.divide(this, other); | ||
} | ||
|
||
@Override | ||
default LongBinding divide(int other) { | ||
|
||
return (LongBinding) Bindings.divide(this, other); | ||
} | ||
|
||
} |
Oops, something went wrong.