/** * Checks if this Id is between two given ids ccw (inclusive) and cw (exclusive) on the circle * * @param ccw the counterclockwise id * @param cw the clockwise id * @return true if this is between ccw (inclusive) and cw (exclusive), false otherwise */ public boolean isBetween(Id ccw, Id cw) { if (ccw.equals(cw)) { return false; } if (ccw.clockwise(cw)) { return this.clockwise(cw) && !this.clockwise(ccw); } else { return !this.clockwise(ccw) || this.clockwise(cw); } }