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

com.aol.cyclops.streams.operators.SkipWhileTimeOperator Maven / Gradle / Ivy

There is a newer version: 7.3.1
Show newest version
package com.aol.cyclops.streams.operators;

import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
import java.util.stream.Stream;

import lombok.Value;

import com.aol.cyclops.sequence.SequenceM;
import com.aol.cyclops.streams.StreamUtils;
@Value
public class SkipWhileTimeOperator {
	Stream stream;
	public  Stream  skipWhile(long time, TimeUnit unit){
		long start = System.nanoTime();
		long allowed = unit.toNanos(time);
		return stream.filter(a-> System.nanoTime()-start > allowed);
		
	}
}