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

📄 duration.java

📁 用于multivariate时间序列分类
💻 JAVA
字号:
/**  * A very simple global extractor. Finds the duration of the   * stream.   *   * @author Waleed Kadous  * @version $Id: Duration.java,v 1.1.1.1 2002/06/28 07:36:16 waleed Exp $  */package tclass.global;   import tclass.*; public class Duration implements GlobalExtractorI {    static final String baseName = "duration";     static final String desc = 	"Finds the duration of the stream";         DomDesc domDesc = null;         // New fields for remembering the channel we are working on.         int chanIndex = 0; // Stores the current channel's index. By default,     // it's the first channel.         public Duration(){	// Any special initialisation code goes here. 	// Can't think of anything special.     }        /**     * Clone the current object.      *     */     public Object clone()    {	try {	    return super.clone(); 	}	catch (CloneNotSupportedException e){	    // Can't happen, or so the java programming book says	    throw new InternalError(e.toString()); 	}    }        /**     * Gets the base name of this global extractor     *     * @return the Extractor's name     */         public String name(){	return baseName;     }    /**     * Returns the datatype of this object.      */     public DataTypeI getDataType(){	// The duration is always a continuous value. So let's ask for it. 	// From the DataTypeMgr. 		DataTypeMgr dtm = DataTypeMgr.getInstance(); 	return (dtm.getClone("continuous"));     }    /**     * Provides a description for the Global Extractor. It explains the      * basic features the Extractor is looking for.      *     * @return A simple description     *      */    public String description(){	return desc;     }    public void setDomDesc(DomDesc d){	domDesc = d;     }    /**      *     * Describes any parameters used by this global extractor,     * to suit a particular domain.      *     * @return A vector of parameters.      */        public ParamVec getParamList() {	ParamVec p = new ParamVec();	// No parameters. 	return p;     }        /**     * Configures this particular extractor so that parameter <i>p</i>      * has value <i>v</i>.     *     * @param p The parameter to set.     * @param v The value of the parameter.      * @return True if the setting succeeded; false otherwise.      */        public void setParam(String p, String v)  throws InvalidParameterException {	throw new InvalidParameterException(p, v, "Unknown parameter.");     }    /**     * Gets the feature that this global is supposed to extract. For     * now, we assume that global extractors return a float. Note     * that this float has a datatype associated with it; which     * explains what it means.      *      * @param s the stream we want to extract the global feature      * from.      * @return The global feature's value.      *     */    public float extract(StreamI s){	return s.numFrames();     } }

⌨️ 快捷键说明

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