public int compareTo(BoundaryDef other) {
    int c = getDirection().compareTo(other.getDirection());
    if (c != 0) {
      return c;
    }

    return this.direction == Direction.PRECEDING ? other.amt - this.amt : this.amt - other.amt;
  }
Returns signed offset from XX PRECEDING/FOLLOWING. Negative for preceding.

@return signed offset from XX PRECEDING/FOLLOWING
ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/BoundaryDef.java