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

net.intelie.pipes.time.LongPeriodBase Maven / Gradle / Ivy

There is a newer version: 0.25.5
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy