📄 attributeusage.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;
/**
* Ways to use an attribute as part of a mining operation. <p>
*
* From CWM Data Mining. <p>
*
* Attributes:
* <ul>
* <li> <i>type</i>: Attribute usage type. Possible is: active, inactive, supplementary. <br>
* - type: Integer <br>
* - multiplicity: exactly one
* </ul>
*/
public class AttributeUsage
{
// -----------------------------------------------------------------------
// Constants of attribute usage
// -----------------------------------------------------------------------
/** Active type. */
public static final int ACTIVE = 0;
/** Inactive type. */
public static final int INACTIVE = 1;
/** Supplementary type (e.g. ID). */
public static final int SUPPLEMENTARY = 2;
// -----------------------------------------------------------------------
// Variables declarations
// -----------------------------------------------------------------------
/** Usage type of attribute. */
private int type = ACTIVE;
// -----------------------------------------------------------------------
// Constructors
// -----------------------------------------------------------------------
/**
* Empty constructor.
*/
public AttributeUsage()
{
}
/**
* Create attribute usage for given type.
*
* @param type attribute usage type
*/
public AttributeUsage( int type )
{
this.type = type;
}
// -----------------------------------------------------------------------
// Getter and setter methods
// -----------------------------------------------------------------------
/**
* Returns attribute usage type.
*
* @return attribute usage type
*/
public int getType() {
return type;
}
/**
* Set attribute usage type.
*
* @param type attribute usage type
*/
public void setType(int type) {
this.type = type;
}
// -----------------------------------------------------------------------
// java.lang.Object methods
// -----------------------------------------------------------------------
/**
* Return attribute usage as string.
*
* @return attribute usage as string
*/
public String toString()
{
if( type == 0 ) return "active";
else
if( type == 1) return "inactive";
else
return "supplementary";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -