📄 datanode.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;
import java.util.Enumeration;
import java.util.Hashtable;
/**
* <p>Title: KBBI Application</p>
* <p>Description: A Knowledge Based Business Intelligence Platform</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: E-Business Technology Institute, HKU</p>
* @author Anny Chiu
* @version 1.0
*/
public class DataNode extends Node {
/**
*
*/
private static final long serialVersionUID = 1L;
private String m_ID;
private String m_Type;
private String m_Location;
private String m_Name;
private String m_Description;
private Hashtable<String, String> m_TableList;
public DataNode() {
super();
}
public DataNode(String a_CaseID) {
super(a_CaseID, NodeFactory.DATA);
m_TableList = new Hashtable<String, String>();
}
public DataNode(String a_CaseID, DataNode a_DataNode) {
super(a_CaseID, NodeFactory.DATA);
setID(a_DataNode.getID());
setType(a_DataNode.getType());
setLocation(a_DataNode.getLocation());
setName(a_DataNode.getName());
setDescription(a_DataNode.getDescription());
m_TableList = new Hashtable<String, String>();
String[][] tables = a_DataNode.getDataTableArray();
for (int i=0; tables!=null && i<tables.length; i++)
setDataTable(tables[i][0], tables[i][1]);
}
public String getID()
{
return m_ID;
}
public void setID(String a_ID)
{
m_ID = a_ID;
}
public String getType()
{
return m_Type;
}
public void setType(String a_Type)
{
m_Type = a_Type;
}
public String getLocation()
{
return m_Location;
}
public void setLocation(String a_Location)
{
m_Location = a_Location;
}
public String getName()
{
return m_Name;
}
public void setName(String a_Name)
{
m_Name = a_Name;
}
public String getDescription()
{
return m_Description;
}
public void setDescription(String a_Description)
{
m_Description = a_Description;
}
public Hashtable<String, String> getDataTable()
{
return m_TableList;
}
public void setDataTable(Hashtable<String, String> a_Table)
{
m_TableList = a_Table;
}
public String[][] getDataTableArray()
{
if (m_TableList.isEmpty())
return null;
String[][] tables = new String[m_TableList.size()][2];
Enumeration<String> em = m_TableList.keys();
String table = null;
String value = null;
int i = 0;
while (em.hasMoreElements())
{
table = em.nextElement();
tables[i][0] = table;
value = m_TableList.get(table);
tables[i][1] = value;
i++;
}
return tables;
}
public String/*DataTable*/ getDataTable(String a_Name)
{
if (a_Name==null)
System.err.println("In DataNode:getDataTable: key is null");
return m_TableList.get(a_Name);
}
public void setDataTable(String a_Key, String a_Table/*DataTable a_Table*/)
{
if (a_Key==null)
System.err.println("In DataNode:setDataTable: key is null");
if (a_Table==null)
System.err.println("In DataNode:setDataTable: table is null");
m_TableList.put(a_Key, a_Table);
}
public int getTableListSize()
{
return m_TableList.size();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -