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

📄 dataset.java,v

📁 包含了模式识别中常用的一些分类器设计算法
💻 JAVA,V
字号:
head	1.4;access;symbols;locks; strict;comment	@# @;1.4date	2005.06.10.18.37.08;	author rirwin;	state Exp;branches;next	1.3;1.3date	2005.05.23.21.48.52;	author rirwin;	state Exp;branches;next	1.2;1.2date	2005.03.10.23.01.26;	author patil;	state Exp;branches;next	1.1;1.1date	2004.12.28.00.04.32;	author patil;	state Exp;branches;next	;desc@@1.4log@Establishing RCS version.@text@/** * file: DataSet.java * * last edited: Ryan Irwin * */// import necessary java libraries//import java.awt.*;import java.util.*;//These imports are not needed - Phil T. 6-23-03//import javax.swing.border.*;//import java.awt.event.*;//import javax.swing.*;/** * class that stores the point of the various decision regions computed * */class DataSet {    // *********************************************************************    //    // declare global variables and components    //    // *********************************************************************        // declare global variables    //    public String name;              // name tag associated with the data set    public Vector<MyPoint> points;   // samples associated with the data set    public Color color;              // color associated with data set samples    // ********************************************************************    //    // declare class constructors    //    // ********************************************************************    /**     * default class constructor     *     */    DataSet() {	// initialize the objects	//	name = new String();	points = new Vector<MyPoint>();    }    /**     * initializes the points included in the data set     *     * @@param   vec Vector of points included in the data set     *     */    DataSet(Vector<MyPoint> vec) {		// initialize the variables	//	name = new String("none");	points = vec;    }    /**     * method: DataSet     *     * @@param   nam name of the data set     * @@param   vec points included in the data set     *     * @@return  none     *     * initializes the name and points included in the data set     *     */    DataSet(String n, Vector<MyPoint> vec) {		// initialize the variables	//	name = n;	points = vec;    }    /**     * initializes the name and a point to the decision region     *     * @@param  n String name of the data set     * @@param  p MyPoint value of new decision region point     */    DataSet(String n, MyPoint p) {		// initialize the variables	//	name = n;	points = new Vector<MyPoint>();	points.addElement(p);    }    // *********************************************************************    //    // declare class methods    //    // *********************************************************************    /**     * set the name of the data set     *     * @@param  n data set name     *     */    public void setName(String n) {	name = n;    }    /**     * retrieves the data set name     *     * return   data set name     */    public String getName() {	return name;    }    /**     * load a new data set     *     * @@param   vec Vector of new data set     *     */    public void loadDataSet(Vector<MyPoint> vec) {	points = vec;    }    /**     * clear the data set presently loaded     *     */    public void clearDataSet() {	points.removeAllElements();    }    /**     * add a new point to the data set     *     * @@param   p MyPoint variable to add     *     */    public void addPoint(MyPoint p) {	points.addElement(p);    }    /**     * retrieves the point at a particular index     *     * @@param  index index of the point     *     * @@return  the indexed point     *     */    public MyPoint getPointAt(int index) {	return (MyPoint)points.elementAt(index);    }    /**     * retrieves the point corresponding to the data set     *     * @@return  point of the data set     */    public Vector<MyPoint> getDataSet() {	return (Vector<MyPoint>)points;    }    /**     * retrieves the size of the data set     *     * @@return  data set size     */    public int dataSetSize() {	return points.size();    }}@1.3log@Fixed javadoc syntax.@text@d8 1d35 1a35 1    public Vector points;            // samples associated with the data setd52 1a52 1	points = new Vector();d61 1a61 1    DataSet(Vector vec) {d72 2a73 2     * @@param   String nam: name of the data set     * @@param   Vector vec: points included in the data setd80 1a80 1    DataSet(String n, Vector vec) {d99 1a99 1	points = new Vector();d133 1a133 1    public void loadDataSet(Vector vec) {d172 2a173 2    public Vector getDataSet() {	return (Vector)points;@1.2log@comments style changed to suit the Java Documentation style.@text@d4 2d19 1a19 3/* * class: DataSet *a42 5     * method: DataSet     *     * @@param   none         * @@return  none     *d55 1a55 3     * method: DataSet     *     * @@param   Vector vec: points included in the data setd57 1a57 3     * @@return  none     *     * initializes the points included in the data seta87 7     * method: DataSet     *     * @@param   String nam: name of the data set     * @@param   Point p: new decision region point     *     * @@return  none     *d90 2d108 1a108 1     * method: setNamed110 1a110 5     * @@param   String n: data set name     *     * @@return  none     *     * set the name of the data setd118 1a118 1     * method: getNamea119 1     * @@param   none    a120 3     *     * retrieves the data set name     *d127 1a127 3     * method: loadDataSet     *     * @@param   Vector: new data setd129 1a129 3     * @@return  none     *     * load a new data seta136 5     * method: clearDataSet     *     * @@param   none         * @@return  none     *d145 1a145 5     * method: addPoint     *     * @@param   Point p: new point     *     * @@return  noned147 1a147 1     * add a new point to the data setd155 1a155 1     * method: getPointAtd157 1a157 1     * @@param   int index: index of the pointa160 2     * retrieves the point at a particular index     *d167 1a167 1     * method: getDataSeta168 1     * @@param   none    a169 3     *     * retrieves the point corresponding to the data set     *d176 1a176 1     * method: dataSetSizea177 1     * @@param   none    a178 3     *     * retrieves the size of the data set     *@1.1log@Initial revision@text@d1 4a4 2// file: DataSet.java//d17 6a22 5// class: DataSet//// class that stores the point of the various decision regions computed//d30 1a30 1d42 9a50 8    // method: DataSet    //    // arguments: none    // return   : none    //    // default class constructor    //d59 10a68 9    // method: DataSet    //    // arguments:    //    Vector vec: points included in the data set    //    // return   : none    //    // initializes the points included in the data set    //d77 11a87 10    // method: DataSet    //    // arguments:    //    String nam: name of the data set    //    Vector vec: points included in the data set    //    // return   : none    //    // initializes the name and points included in the data set    //d96 11a106 10    // method: DataSet    //    // arguments:    //    String nam: name of the data set    //    Point p: new decision region point    //    // return   : none    //    // initializes the name and a point to the decision region    //d121 10a130 10    // method: setName    //    // arguments:    //    String n: data set name    //    // return   : none    //    // set the name of the data set    //d135 9a143 7    // method: getName    //    // arguments: none    // return   : data set name    //    // retrieves the data set name    //d148 10a157 9    // method: loadDataSet    //    // arguments:    //    Vector: new data set    //    // return   : none    //    // load a new data set    //d162 9a170 7    // method: clearDataSet    //    // arguments: none    // return   : none    //    // clear the data set presently loaded    //d175 10a184 9    // method: addPoint    //    // arguments:    //    Point p: new point    //    // return   : none    //    // add a new point to the data set    //d189 10a198 9    // method: getPointAt    //    // arguments:    //    int index: index of the point    //    // return   : the indexed point    //    // retrieves the point at a particular index    //d203 9a211 7    // method: getDataSet    //    // arguments: none    // return   : point of the data set    //    // retrieves the point corresponding to the data set    //d216 9a224 7    // method: dataSetSize    //    // arguments: none    // return   : data set size    //    // retrieves the size of the data set    //a228 3//// end of file@

⌨️ 快捷键说明

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