protected long roundTime(long time) { long value; long roundUpAmount = getRoundUpAmount(); if (time <= Long.MAX_VALUE - roundUpAmount) { // If no overflow, add value = (time + roundUpAmount) / divBy; } else { // Else subtract and add one value = (time - roundUpAmount) / divBy + 1; } return value * divBy; }
@Override public int hashCode() { final int prime = 31; int result = 1; long roundUpAmount = this.getRoundUpAmount(); result = prime * result + (int)(divBy ^ (divBy >>> 32)); result = prime * result + (int)(roundUpAmount ^ (roundUpAmount >>> 32)); result = prime * result + children.get(0).hashCode(); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RoundDateExpression other = (RoundDateExpression)obj; if (divBy != other.divBy) return false; if (getRoundUpAmount() != other.getRoundUpAmount()) return false; return children.get(0).equals(other.children.get(0)); }
protected long roundTime(long time) { long value; long roundUpAmount = getRoundUpAmount(); if (time <= Long.MAX_VALUE - roundUpAmount) { // If no overflow, add value = (time + roundUpAmount) / divBy; } else { // Else subtract and add one value = (time - roundUpAmount) / divBy + 1; } return value * divBy; }
protected long roundTime(long time) { time += DateUtil.DEFAULT_TIME_ZONE_OFFSET; long value; long roundUpAmount = getRoundUpAmount(); if (time <= Long.MAX_VALUE - roundUpAmount) { // If no overflow, add value = (time + roundUpAmount) / divBy; } else { // Else subtract and add one value = (time - roundUpAmount) / divBy + 1; } return value * divBy - DateUtil.DEFAULT_TIME_ZONE_OFFSET; }
@Override public int hashCode() { final int prime = 31; int result = 1; long roundUpAmount = this.getRoundUpAmount(); result = prime * result + (int)(divBy ^ (divBy >>> 32)); result = prime * result + (int)(roundUpAmount ^ (roundUpAmount >>> 32)); result = prime * result + children.get(0).hashCode(); return result; }
@Override public int hashCode() { final int prime = 31; int result = 1; long roundUpAmount = this.getRoundUpAmount(); result = prime * result + (int)(divBy ^ (divBy >>> 32)); result = prime * result + (int)(roundUpAmount ^ (roundUpAmount >>> 32)); result = prime * result + children.get(0).hashCode(); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RoundDateExpression other = (RoundDateExpression)obj; if (divBy != other.divBy) return false; if (getRoundUpAmount() != other.getRoundUpAmount()) return false; return children.get(0).equals(other.children.get(0)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RoundDateExpression other = (RoundDateExpression)obj; if (divBy != other.divBy) return false; if (getRoundUpAmount() != other.getRoundUpAmount()) return false; return children.get(0).equals(other.children.get(0)); }