timetable.java

来自「Java数据结构开发包」· Java 代码 · 共 26 行

JAVA
26
字号
package support;

import jdsl.core.api.*;
import jdsl.graph.api.*;

/**
  * This class contains static methods for doing time arithmetic.
  *
  * @version JDSL 2
  */

public class TimeTable {
  
  // Compute the difference between times a and b, taking into account
  // the possiblity of crossing days.
  public static int diff(int a, int b) {
    int result = (a - b) % 1440;

    if (result < 0) 
      result += 1440;

    return result;
  }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?