net.anotheria.access.constraints.RangeEndpoint Maven / Gradle / Ivy
The newest version!
package net.anotheria.access.constraints;
import java.io.Serializable;
import net.anotheria.util.NumberUtils;
/**
* Represents an endpoint of a range.
* @author another
*
*/
public class RangeEndpoint implements Serializable{
/**
* Limit in millis.
*/
private long timeMills;
/**
* True if the point is inclusive.
*/
private boolean inclusive;
public RangeEndpoint(long aTimeMillis, boolean anInclusive){
timeMills = aTimeMillis;
inclusive = anInclusive;
}
public boolean isValueRightOf(long value){
return inclusive ?
value >= timeMills : value >timeMills;
}
public boolean isValueLeftOf(long value){
return inclusive ?
value <= timeMills : value
© 2015 - 2025 Weber Informatics LLC | Privacy Policy