📄 returnflags.java
字号:
/*
* ReturnFlags.java -
*
* This file is part of the Jawin Project: http://jawinproject.sourceforge.net/
*
* Please consult the LICENSE file in the project root directory,
* or at the project site before using this software.
*/
/* $Id: ReturnFlags.java,v 1.3 2004/06/14 20:08:14 arosii_moa Exp $ */
package org.jawin;
/**
* Static constants for specifying how error handling should occur in
* the native code. These flags should be used in the eg. the
* {@link FuncPtr} invoke*() methods.
*
* @version $Revision: 1.3 $
* @author Stuart Halloway, http://www.relevancellc.com/halloway/weblog/
*/
public class ReturnFlags {
public final int value;
/**
* the human readable ReturnFlag message - used in toString()
*/
private final String msg;
/**
* only the static constant instances defined in this
* class exists, therefore the constructor is private.
*/
private ReturnFlags(int value, String msg) {
this.value = value;
this.msg = msg;
}
/**
* used when no checking of return values should be done in the
* native code. (was previously called DONT_CARE).
*/
public static final ReturnFlags CHECK_NONE = new ReturnFlags(0, "CHECK_NONE");
/**
* used when the native code should throw an exception
* if <code>(!ret)</code>. The error-message
* will be based on <code>GetLastError()</code>.
* (was previously called FAIL_ON_FALSE).
*/
public static final ReturnFlags CHECK_FALSE = new ReturnFlags(1, "CHECK_FALSE");
/**
* used when the native code should throw an exception
* if <code>FAILED(hr)</code>. The error-message will
* be based on the <code>HRESULT</code>-value.
*/
public static final ReturnFlags CHECK_HRESULT = new ReturnFlags(2, "CHECK_HRESULT");
/**
* used when the native code should throw an exception
* if the return value is not <code>ERROR_SUCCESS</code>.
* The error-message will be based on the return value.
* (was previously called MUST_BE_FALSE).
*/
public static final ReturnFlags CHECK_W32 = new ReturnFlags(3, "CHECK_W32");
public String toString() {
return "[" + msg + " (" + value + ")]";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -