All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.stream.impl.intops.primitive.d.MapToIntDoubleOperation Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.stream.impl.intops.primitive.d;

import org.infinispan.stream.impl.intops.IntermediateOperation;

import java.util.function.DoubleToIntFunction;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;

/**
 * Performs map to int operation on a {@link DoubleStream}
 */
public class MapToIntDoubleOperation implements IntermediateOperation {
   private final DoubleToIntFunction function;

   public MapToIntDoubleOperation(DoubleToIntFunction function) {
      this.function = function;
   }

   @Override
   public IntStream perform(DoubleStream stream) {
      return stream.mapToInt(function);
   }

   public DoubleToIntFunction getFunction() {
      return function;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy