splitter.cpp

来自「粗糙集应用软件」· C++ 代码 · 共 96 行

CPP
96
字号
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================

#include <stdafx.h> // Precompiled headers.
#include <copyright.h>

#include <kernel/algorithms/splitter.h>
#include <kernel/algorithms/keyword.h>

#include <kernel/structures/decisiontable.h>

//-------------------------------------------------------------------
// Methods for class Splitter.
//===================================================================

//-------------------------------------------------------------------
// Constructors/destructor.
//===================================================================

Splitter::Splitter() {
	AppendAsChildren(true);
}

Splitter::~Splitter() {
}

//-------------------------------------------------------------------
// Methods inherited from Identifier.
//===================================================================

IMPLEMENTIDMETHODS(Splitter, SPLITTER, Algorithm)

//-------------------------------------------------------------------
// Methods inherited from Algorithm.
//===================================================================

//-------------------------------------------------------------------
// Method........: GetParameters
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

String
Splitter::GetParameters() const {

	String parameters;

	parameters += Keyword::Append();
	parameters += Keyword::Assignment();
	parameters += String::Format(AppendAsChildren());

	return parameters;

}

//-------------------------------------------------------------------
// Method........: SetParameter
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

bool
Splitter::SetParameter(const String &keyword, const String &value) {

	if (keyword == Keyword::Append() && value.IsBoolean())
		return AppendAsChildren(value.GetBoolean());

	return false;

}

//-------------------------------------------------------------------
// Method........: IsApplicable
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Returns true if the algorithm is applicable to the
//                 structure, false otherwise.
// Comments......:
// Revisions.....:
//===================================================================

bool
Splitter::IsApplicable(const Structure &structure, bool /*warn*/) const {
	return structure.IsA(DECISIONTABLE);
}

⌨️ 快捷键说明

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