?? node.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.
*/
package eti.bi.alphaminer.vo;
/**
* Node is a class which represents an operation.
*/
public class Node implements INode {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Node details
*/
private String m_CaseID;
private String m_NodeID;
private int m_NodeType;
private int m_Status;
private int m_MaxNumParent;
private int m_MaxNumChild;
private int m_MinNumParent;
private int m_MinNumChild;
/**
* Node visualization details
*/
private String m_NodeDescription;
private VisualProperty m_VisualProperty;
/**
* Constructs a Node
*/
public Node() {
m_CaseID = "UnDefined Case ID";
m_NodeType = 0;
m_VisualProperty = new VisualProperty();
}
/**
* Constructs a Node.
* @param a_CaseID ID of the Case containing this Node.
* @param a_NodeType type of the Node.
*/
protected Node(String a_CaseID, int a_NodeType) {
m_CaseID = a_CaseID;
m_NodeType = a_NodeType;
m_MaxNumParent = 10;
m_MaxNumChild = 4;
m_MinNumParent = 0;
m_MinNumChild = 0;
m_VisualProperty = new VisualProperty();
}
/**
* Set node properties by copying another Node.
* @param a_Node Node to be copied.
*/
protected void copyNodeProperty(Node a_Node) {
setNodeID(a_Node.getNodeID());
setStatus(a_Node.getStatus());
setMaxNumParent(a_Node.getMaxNumParent());
setMinNumParent(a_Node.getMinNumParent());
setMaxNumChild(a_Node.getMaxNumChild());
setMinNumChild(a_Node.getMinNumChild());
setNodeDescription(a_Node.getNodeDescription());
setPositionX(a_Node.getPositionX());
setPositionY(a_Node.getPositionY());
}
/**
* Gets ID of the Node.
* @return ID of the Node.
*/
public String getNodeID() {
return m_NodeID;
}
/**
* Sets ID of the Node.
* @param a_NodeID ID of the Node.
*/
public void setNodeID(String a_NodeID) {
if (a_NodeID == null && this instanceof OperatorNode)
System.err.println("In Node:setNodeID: node ID is null");
m_NodeID = a_NodeID;
}
/**
* Gets ID of the Case containing this Node.
* @return ID of the Case.
*/
public String getCaseID() {
return m_CaseID;
}
/**
* Sets ID of the Case containing this Node.
* @param a_CaseID ID of the Case.
*/
public void setCaseID(String a_CaseID) {
if (a_CaseID == null)
System.err.println("In Node:setCaseID: node ID is null");
m_CaseID = a_CaseID;
}
/**
* Gets type of this Node.
* @return type of the Node.
*/
public int getNodeType() {
return m_NodeType;
}
/**
* Gets the status of the node.
* @return status of the node.
*/
public int getStatus() {
return m_Status;
}
/**
* Sets the status of the node.
* @param a_Status status to be set.
*/
public void setStatus(int a_Status) {
m_Status = a_Status;
}
/**
* Gets the maximum number of parent nodes allowed to be connected to this node.
* @return the maximum number of parent nodes allowed.
*/
public int getMaxNumParent() {
return m_MaxNumParent;
}
/**
* Sets the maximum number of parent nodes allowed to be connected to this node.
* @param a_Num maximum number of parent nodes allowed.
*/
public void setMaxNumParent(int a_Num) {
m_MaxNumParent = a_Num;
}
/**
* Gets the maximum number of child nodes allowed to be connected to this node.
* @return the maximum number of child nodes allowed.
*/
public int getMaxNumChild() {
return m_MaxNumChild;
}
/**
* Sets the maximum number of child nodes allowed to be connected to this node.
* @param a_Num maximum number of child nodes allowed.
*/
public void setMaxNumChild(int a_Num) {
m_MaxNumChild = a_Num;
}
/**
* Gets description of node.
* @return description of node.
*/
public String getNodeDescription() {
return m_NodeDescription;
}
/**
* Sets node description.
* @param a_Description description to be set.
*/
public void setNodeDescription(String a_Description) {
m_NodeDescription = a_Description;
}
/**
* Gets the X-Position of the node in the CaseWindow editing/viewing panel.
* @return X-Position of the node.
*/
public double getPositionX() {
return m_VisualProperty.getPositionX();
}
/**
* Sets the X-Position of the node in the CaseWindow editing/viewing panel.
* @param a_Position X-Position to be set.
*/
public void setPositionX(double a_Position) {
m_VisualProperty.setPositionX(a_Position);
}
/**
* Gets the Y-Position of the node in the CaseWindow editing/viewing panel.
* @return Y-Position of the node.
*/
public double getPositionY() {
return m_VisualProperty.getPositionY();
}
/**
* Sets the Y-Position of the node in the CaseWindow editing/viewing panel.
* @param a_Position Y-Position to be set.
*/
public void setPositionY(double a_Position) {
m_VisualProperty.setPositionY(a_Position);
}
/**
* @return Returns the m_MinNumChild.
*/
public int getMinNumChild() {
return m_MinNumChild;
}
/**
* @param minNumChild The m_MinNumChild to set.
*/
public void setMinNumChild(int minNumChild) {
m_MinNumChild = minNumChild;
}
/**
* @return Returns the m_MinNumParent.
*/
public int getMinNumParent() {
return m_MinNumParent;
}
/**
* @param minNumParent The m_MinNumParent to set.
*/
public void setMinNumParent(int minNumParent) {
m_MinNumParent = minNumParent;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -