-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime-compute: Add HasMapToDouble trait
- Loading branch information
Emil Forslund
committed
May 8, 2018
1 parent
f085c05
commit 31ed3db
Showing
12 changed files
with
87 additions
and
4 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
2 changes: 2 additions & 0 deletions
2
runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/ToChar.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
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
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
27 changes: 27 additions & 0 deletions
27
...ent/runtime-compute/src/main/java/com/speedment/runtime/compute/trait/HasMapToDouble.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,27 @@ | ||
package com.speedment.runtime.compute.trait; | ||
|
||
import com.speedment.runtime.compute.ToDouble; | ||
|
||
/** | ||
* Trait for expressions that can be mapped to a new expression of the same type | ||
* by supplying a mapping function. | ||
* | ||
* @param <T> the input entity type | ||
* @param <MAPPER> the functional interface used for mapping values | ||
* | ||
* @author Emil Forslund | ||
* @since 3.1.0 | ||
*/ | ||
public interface HasMapToDouble<T, MAPPER> { | ||
|
||
/** | ||
* Maps the result of this expression into a {@code double} by passing it to | ||
* the specified {@code mapper}, producing a new expression that implements | ||
* {@link ToDouble}. | ||
* | ||
* @param mapper the mapper to use on the result of this expression | ||
* @return the new mapped expression | ||
*/ | ||
ToDouble<T> mapToDouble(MAPPER mapper); | ||
|
||
} |