コード例 #1
0
ファイル: Controller.java プロジェクト: mawright/beats-old
    @Override
    public int compareTo(ActivationTimes that) {
      if (that == null) return 1;

      // Order first by begintimes.
      int compare = ((Double) this.getBegintime()).compareTo((Double) that.getBegintime());

      if (compare != 0) return compare;

      // Order next by endtimes.
      compare = ((Double) this.getEndtime()).compareTo((Double) that.getEndtime());

      return compare;
    }
コード例 #2
0
ファイル: Controller.java プロジェクト: mawright/beats-old
 protected void validateWith(ActivationTimes that) {
   if (Math.max(this.begintime - that.getEndtime(), that.getBegintime() - this.endtime)
       < 0) // Assumption - activation times is sorted before this is invoked, should remove this
            // assumption later.
   BeatsErrorLog.addError("Activation Periods of the controllers must not overlap.");
 }