📄 categoryproperty.java
字号:
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/**
* Title: XELOPES Data Mining Library
* Description: The XELOPES library is an open platform-independent and data-source-independent library for Embedded Data Mining.
* Copyright: Copyright (c) 2002 Prudential Systems Software GmbH
* Company: ZSoft (www.zsoft.ru), Prudsys (www.prudsys.com)
* @author Valentine Stepanenko (valentine.stepanenko@zsoft.ru)
* @version 1.0
*/
package com.prudsys.pdm.Core;
/**
* Category properties like "missing", "valid", "positive". <p>
*
* From CWM Data Mining. <p>
*
* Attributes:
* <ul>
* <li> <i>type</i>: Category property type. Possible is: missing, invalid, valid,
* positive, negative. <br>
* - type: Integer <br>
* - multiplicity: exactly one
* </ul>
*
* @see Category
*/
public class CategoryProperty
{
// -----------------------------------------------------------------------
// Constants of various category properties
// -----------------------------------------------------------------------
/** Missing value. */
public static final int MISSING = 0;
/** Invalid value. */
public static final int INVALID = 1;
/** Valid value. */
public static final int VALID = 2;
/** Positive value. */
public static final int POSITIVE = 3;
/** Negative value. */
public static final int NEGATIVE = 4;
// -----------------------------------------------------------------------
// Variables declarations
// -----------------------------------------------------------------------
/** Type of category property. */
private int type = VALID;
// -----------------------------------------------------------------------
// Constructors
// -----------------------------------------------------------------------
/**
* Empty constructor.
*/
public CategoryProperty()
{
}
/**
* Create category property from given type.
*
* @param type of category property
*/
public CategoryProperty( int type )
{
this.type = type;
}
// -----------------------------------------------------------------------
// Getter and setter methods
// -----------------------------------------------------------------------
/**
* Returns type of category property.
*
* @return type of category property
*/
public int getType() {
return type;
}
/**
* Set type of category property.
*
* @param type type of category property
*/
public void setType(int type) {
this.type = type;
}
// -----------------------------------------------------------------------
// java.lang.Object methods
// -----------------------------------------------------------------------
/**
* Returns string representation of category property.
*
* @return category property as string
*/
public String toString()
{
if( type == 0 ) return "missing";
else
if( type == 1) return "invalid";
else
if( type == 2) return "valid";
else
if( type == 3) return "positive";
else
if( type == 4) return "negative";
else
return "unknown type";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -