basicvaluehandler.java

来自「本算法是实现基于KNN的基因遗传算法」· Java 代码 · 共 38 行

JAVA
38
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package gaknn.datapreprocess;import gaknn.core.Attribute;/** * * @author Niro */public class BasicValueHandler extends ValueHandler{        public double GetValue(int attrbuteType, int index, String sValue){        double retValue = DefaultValue;        switch (attrbuteType) {        case  Attribute.STRING:            retValue = DefaultValue;        case Attribute.NOMINAL:            Attribute attribute;            attribute = (Attribute) m_Attributes.elementAt(index);            retValue = attribute.IndexOfValue(sValue);                        if (retValue == -1)                retValue = DefaultValue;        }        return retValue;    }        public double GetMissingValue(int attrbuteType, int index){        return DefaultValue;    }}

⌨️ 快捷键说明

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