java.util.stream.Stream#mapToDouble ( )源码实例Demo

下面列出了java.util.stream.Stream#mapToDouble ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

private DoubleStream mapToDouble(Stream<NullableContainer<String>> stream) {
  // BUG: Diagnostic contains: dereferenced expression
  return stream.mapToDouble(c -> c.get().length());
}
 
源代码2 项目: finmath-lib   文件: TimeDiscretizationFromArray.java
/**
 * Constructs a time discretization using the given tick size.
 *
 * @param times    A non closed and not necessarily sorted stream containing the time points.
 * @param tickSize A non-negative double representing the smallest time span distinguishable.
 * @param allowDuplicates If true, the time discretization allows duplicate entries.
 */
public TimeDiscretizationFromArray(final Stream<Double> times, final double tickSize, final boolean allowDuplicates) {
	this(times.mapToDouble(Double::doubleValue), tickSize, allowDuplicates);
}
 
源代码3 项目: finmath-lib   文件: TimeDiscretizationFromArray.java
/**
 * Constructs a time discretization using the given tick size.
 * The time discretization will be sorted. Duplicate entries are allowed if <code>allowDuplicates</code> is true, otherwise duplicate entries are removed.
 *
 * @param times    A non closed and not necessarily sorted stream containing the time points.
 * @param tickSize A non-negative double representing the smallest time span distinguishable.
 */
public TimeDiscretizationFromArray(final Stream<Double> times, final double tickSize) {
	this(times.mapToDouble(Double::doubleValue), tickSize, false);
}
 
源代码4 项目: finmath-lib   文件: TimeDiscretizationFromArray.java
/**
 * Constructs a time discretization from a (non closed and not necessarily sorted) stream of boxed doubles.
 *
 * @param times A double stream of time points for the time discretization.
 */
public TimeDiscretizationFromArray(final Stream<Double> times) {
	this(times.mapToDouble(Double::doubleValue), timeTickSizeDefault, false);
}
 
源代码5 项目: finmath-lib   文件: TimeDiscretizationFromArray.java
/**
 * Constructs a time discretization using the given tick size.
 *
 * @param times    A non closed and not necessarily sorted stream containing the time points.
 * @param tickSize A non-negative double representing the smallest time span distinguishable.
 * @param allowDuplicates If true, the time discretization allows duplicate entries.
 */
public TimeDiscretizationFromArray(final Stream<Double> times, final double tickSize, final boolean allowDuplicates) {
	this(times.mapToDouble(Double::doubleValue), tickSize, allowDuplicates);
}
 
源代码6 项目: finmath-lib   文件: TimeDiscretizationFromArray.java
/**
 * Constructs a time discretization using the given tick size.
 * The time discretization will be sorted. Duplicate entries are allowed if <code>allowDuplicates</code> is true, otherwise duplicate entries are removed.
 *
 * @param times    A non closed and not necessarily sorted stream containing the time points.
 * @param tickSize A non-negative double representing the smallest time span distinguishable.
 */
public TimeDiscretizationFromArray(final Stream<Double> times, final double tickSize) {
	this(times.mapToDouble(Double::doubleValue), tickSize, false);
}
 
源代码7 项目: finmath-lib   文件: TimeDiscretizationFromArray.java
/**
 * Constructs a time discretization from a (non closed and not necessarily sorted) stream of boxed doubles.
 *
 * @param times A double stream of time points for the time discretization.
 */
public TimeDiscretizationFromArray(final Stream<Double> times) {
	this(times.mapToDouble(Double::doubleValue), timeTickSizeDefault, false);
}