comes_before method Null safety

bool comes_before(
  1. Interval other
)

Implementation

bool comes_before(Interval other) {
  if (this == other) {
    return false;
  } else if (this.lowerBound < other.lowerBound) {
    return true;
  } else if (this.lowerBound > other.lowerBound) {
    return false;
  } else if (this.lowerClosed == other.lowerClosed) {
    if (this.upperBound < other.upperBound) {
      return true;
    } else if (this.upperBound > other.upperBound ||
        this.upperClosed == other.upperClosed ||
        this.upperClosed) {
      return false;
    } else {
      return true;
    }
  } else if (this.lowerClosed) {
    return true;
  } else {
    return false;
  }
}