本文整理汇总了Java中java.util.function.LongToDoubleFunction.applyAsDouble方法的典型用法代码示例。如果您正苦于以下问题:Java LongToDoubleFunction.applyAsDouble方法的具体用法?Java LongToDoubleFunction.applyAsDouble怎么用?Java LongToDoubleFunction.applyAsDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.function.LongToDoubleFunction
的用法示例。
在下文中一共展示了LongToDoubleFunction.applyAsDouble方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
@Override
public double[] call() throws Exception {
double[] output = new double[size];
LongToDoubleFunction mapper = RealDistributions.forSpec(mapperSpec);
// System.out.println("resolved:" + mapper);
// System.out.flush();
synchronized (signal) {
signal.wait(10000);
}
for (int i = 0; i < output.length; i++) {
output[i] = mapper.applyAsDouble(i);
// if ((i % 100) == 0) {
// System.out.println("wrote t:" + slot + ", iter:" + i + ", val:" + output[i]);
// }
}
return output;
}
示例2: F
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
F(LongToDoubleFunction longToDoubleFunction) {
this((Function<T, R>) new Function<Long, Double>() {
@Override
public Double apply(Long t) {
return longToDoubleFunction.applyAsDouble(t);
}
});
}
示例3: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link BiBooleanToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result. If evaluation of either operation throws an exception, it is
* relayed to the caller of the composed operation. This method is just convenience, to provide the ability to
* transform this primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code BiBooleanToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default BiBooleanToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (value1, value2) -> after.applyAsDouble(applyAsLong(value1, value2));
}
示例4: onlyThird
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Creates a {@link TriLongToDoubleFunction} which uses the {@code third} parameter of this one as argument for the
* given {@link LongToDoubleFunction}.
*
* @param function The function which accepts the {@code third} parameter of this one
* @return Creates a {@code TriLongToDoubleFunction} which uses the {@code third} parameter of this one as argument
* for the given {@code LongToDoubleFunction}.
* @throws NullPointerException If given argument is {@code null}
*/
@Nonnull
static TriLongToDoubleFunction onlyThird(@Nonnull final LongToDoubleFunction function) {
Objects.requireNonNull(function);
return (value1, value2, value3) -> function.applyAsDouble(value3);
}
示例5: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link ObjIntToDoubleFunction} that first applies this function to its input, and then applies
* the {@code after} function to the result. If evaluation of either operation throws an exception, it is relayed to
* the caller of the composed operation. This method is just convenience, to provide the ability to transform this
* primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code ObjIntToDoubleFunction} that first applies this function to its input, and then applies
* the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default ObjIntToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (t, value) -> after.applyAsDouble(applyAsLong(t, value));
}
示例6: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link BiByteToDoubleFunction} that first applies this function to its input, and then applies
* the {@code after} function to the result. If evaluation of either operation throws an exception, it is relayed to
* the caller of the composed operation. This method is just convenience, to provide the ability to transform this
* primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code BiByteToDoubleFunction} that first applies this function to its input, and then applies
* the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default BiByteToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (value1, value2) -> after.applyAsDouble(applyAsLong(value1, value2));
}
示例7: onlySecond
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Creates a {@link ObjBiLongToDoubleFunction} which uses the {@code second} parameter of this one as argument for
* the given {@link LongToDoubleFunction}.
*
* @param <T> The type of the first argument to the function
* @param function The function which accepts the {@code second} parameter of this one
* @return Creates a {@code ObjBiLongToDoubleFunction} which uses the {@code second} parameter of this one as
* argument for the given {@code LongToDoubleFunction}.
* @throws NullPointerException If given argument is {@code null}
*/
@Nonnull
static <T> ObjBiLongToDoubleFunction<T> onlySecond(@Nonnull final LongToDoubleFunction function) {
Objects.requireNonNull(function);
return (t, value1, value2) -> function.applyAsDouble(value1);
}
示例8: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link TriFloatToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result. If evaluation of either operation throws an exception, it is
* relayed to the caller of the composed operation. This method is just convenience, to provide the ability to
* transform this primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code TriFloatToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default TriFloatToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (value1, value2, value3) -> after.applyAsDouble(applyAsLong(value1, value2, value3));
}
示例9: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link ObjBiCharToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result. If evaluation of either operation throws an exception, it is
* relayed to the caller of the composed operation. This method is just convenience, to provide the ability to
* transform this primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code ObjBiCharToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default ObjBiCharToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2));
}
示例10: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link ObjBiDoubleToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result. If evaluation of either operation throws an exception, it is
* relayed to the caller of the composed operation. This method is just convenience, to provide the ability to
* transform this primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code ObjBiDoubleToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default ObjBiDoubleToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2));
}
示例11: onlyFirst
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Creates a {@link BiLongToDoubleFunction} which uses the {@code first} parameter of this one as argument for the
* given {@link LongToDoubleFunction}.
*
* @param function The function which accepts the {@code first} parameter of this one
* @return Creates a {@code BiLongToDoubleFunction} which uses the {@code first} parameter of this one as argument
* for the given {@code LongToDoubleFunction}.
* @throws NullPointerException If given argument is {@code null}
*/
@Nonnull
static BiLongToDoubleFunction onlyFirst(@Nonnull final LongToDoubleFunction function) {
Objects.requireNonNull(function);
return (value1, value2) -> function.applyAsDouble(value1);
}
示例12: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link CharToDoubleFunction} that first applies this function to its input, and then applies
* the {@code after} function to the result. If evaluation of either operation throws an exception, it is relayed to
* the caller of the composed operation. This method is just convenience, to provide the ability to transform this
* primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code CharToDoubleFunction} that first applies this function to its input, and then applies
* the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default CharToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (value) -> after.applyAsDouble(applyAsLong(value));
}
示例13: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link BiObjIntToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result. If evaluation of either operation throws an exception, it is
* relayed to the caller of the composed operation. This method is just convenience, to provide the ability to
* transform this primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code BiObjIntToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default BiObjIntToDoubleFunction<T, U> andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (t, u, value) -> after.applyAsDouble(applyAsLong(t, u, value));
}
示例14: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link ObjBiShortToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result. If evaluation of either operation throws an exception, it is
* relayed to the caller of the composed operation. This method is just convenience, to provide the ability to
* transform this primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code ObjBiShortToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default ObjBiShortToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2));
}
示例15: andThenToDouble
import java.util.function.LongToDoubleFunction; //导入方法依赖的package包/类
/**
* Returns a composed {@link BiObjFloatToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result. If evaluation of either operation throws an exception, it is
* relayed to the caller of the composed operation. This method is just convenience, to provide the ability to
* transform this primitive function to an operation returning {@code double}.
*
* @param after The function to apply after this function is applied
* @return A composed {@code BiObjFloatToDoubleFunction} that first applies this function to its input, and then
* applies the {@code after} function to the result.
* @throws NullPointerException If given argument is {@code null}
* @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code
* double}.
*/
@Nonnull
default BiObjFloatToDoubleFunction<T, U> andThenToDouble(@Nonnull final LongToDoubleFunction after) {
Objects.requireNonNull(after);
return (t, u, value) -> after.applyAsDouble(applyAsLong(t, u, value));
}