intref.java

来自「用C编写的数据挖掘的相关算法」· Java 代码 · 共 33 行

JAVA
33
字号
package shared;
import java.lang.*;
/** This is an integer wrapper, made because the JDK1.2.2 Integer wrapper
 * doesn't allow changes to be made to the integer value.
 * @author James Louis.
 */
public class IntRef{

    /** The value of this wrapper.
     */
	public int value;

        /** Constructor. Sets value to 0 by default.
         */
	public IntRef(){ value = 0;}

        /** Constructor.
         * @param v The value to be stored in this wrapper.
         */
	public IntRef(int v){value = v;}

        /** Converts this wrapper to a String.
         * @return A String representation of the value stored in this wrapper.
         */
	public String toString(){return Integer.toString(value);}

        /** Compares this IntRef object to the specified IntRef object.
         * @return True if the values are equal, false otherwise.
         * @param rhs The Object to be compared to.
         */
	public boolean equals(Object rhs){return ((IntRef)rhs).value == value;}

}

⌨️ 快捷键说明

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