integerattribute.java

来自「很棒的web服务器源代码」· Java 代码 · 共 53 行

JAVA
53
字号
// IntegerAttribute.java// $Id: IntegerAttribute.java,v 1.5 2002/06/09 09:45:28 ylafon Exp $// (c) COPYRIGHT MIT and INRIA, 1996.// Please first read the full copyright statement in file COPYRIGHT.htmlpackage org.w3c.tools.resources ;/** * The generic description of an IntegerAttribute. */public class IntegerAttribute extends SimpleAttribute {    /**     * Is the given object a valid IntegerAttribute value ?     * @param obj The object to test.     * @return A boolean <strong>true</strong> if okay.     */    public boolean checkValue(Object obj) {	return (obj instanceof Integer) || (obj == null) ;    }    /**     * Pickle an integer to the given output stream.     * @param obj The object to pickle.     */    public String pickle(Object obj) {	return ((Integer) obj).toString();    }    /**     * Unpickle an integer from the given input stream.     * @param value the string representation of this integer     * @return An instance of Integer.     */    public Object unpickle (String value) {	return Integer.valueOf(value);    }    public IntegerAttribute(String name, Integer def, int flags) {	super(name, def, flags) ;	this.type = "java.lang.Integer".intern();    }    public IntegerAttribute() {	super();    }}

⌨️ 快捷键说明

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