net.intelie.pipes.time.LongPeriodBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pipes-api Show documentation
Show all versions of pipes-api Show documentation
Intelie Pipes' API classes and interfaces
package net.intelie.pipes.time;
public class LongPeriodBase implements PeriodBase {
private static final long serialVersionUID = 1L;
private final long period;
public LongPeriodBase(long period) {
this.period = period;
}
@Override
public long add(long timestamp) {
return timestamp + period;
}
@Override
public long sub(long timestamp) {
return timestamp - period;
}
@Override
public long floor(long timestamp) {
return timestamp - timestamp % period;
}
@Override
public long estimateMillis() {
return period;
}
}