⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 assert.java

📁 A Practical Introduction to Data Structures and Algorithm Analysis 一书的java源代码。对算法学习有非常高参考价值。
💻 JAVA
字号:
// package gjt;

/**
 * A simple assertion mechanism for asserting validity of
 * arguments.<p>
 *
 * @version 1.0, Apr 1 1996
 * @author  David Geary
 */
class Assert {
    static public void notFalse(boolean b)
                       throws IllegalArgumentException {
        if(b == false)
            throw new IllegalArgumentException(
                            "boolean expression false");
    }
    static public void notNull(Object obj)
                       throws IllegalArgumentException {
        if(obj == null)
            throw new IllegalArgumentException("null argument");
    }

    static public void notFalse(boolean b, String s)
                               throws IllegalArgumentException {
        if(b == false)
            throw new IllegalArgumentException(s);
    }
    static public void notNull(Object obj, String s)
                               throws IllegalArgumentException {
        if(obj == null)
            throw new IllegalArgumentException(s);
    }
}

⌨️ 快捷键说明

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