/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.connor.ml.tcm.outfile.bean;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode;

import com.connor.ml.tcm.outfile.ML_01.BomValBean;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentItemRevision;

/**
 *
 * @author vearn
 */
public class NodeBean {

    private String dbom;//对象ID
    private String ebom;//对象名称
//    private String ebomId;//对象名称
//    private String ebomDesc;//物料描述
    private String num;//数量
    private String label;//对象名称
    private String refreshStatus;//发布状态
    private String parentString;//对应父节点
//    private String bl_plmxml_abs_xform ;//绝对变换矩阵
    private TCComponentItemRevision pRev;//对应父节点
    private TCComponentItemRevision rev;//对应父节点
    private TCComponent tcComponent;
    private Boolean isTw = false;
    private DefaultMutableTreeTableNode rootNode;
	private Map<TCComponentItemRevision, List<BomValBean>> bomValMap = new HashMap<TCComponentItemRevision, List<BomValBean>>();
	
	public static int DBOM = 0;
	public static int PARENT = 1;
	public static int EBOM = 2;
	public static int STATUS = 3;
	public static int LABEL = 4;
    
    private HashMap<Integer, String> values = new HashMap<>();
    private TCComponentBOMLine bomLine;
    
    public Boolean getIsTw() {
		return isTw;
	}
	public DefaultMutableTreeTableNode getRootNode() {
		return rootNode;
	}
	public void setRootNode(DefaultMutableTreeTableNode rootNode) {
		this.rootNode = rootNode;
	}
	public void setIsTw(Boolean isTw) {
		this.isTw = isTw;
	}
	public TCComponent getTcComponent() {
		return tcComponent;
	}
	public void setTcComponent(TCComponent tcComponent) {
		this.tcComponent = tcComponent;
	}
	public TCComponentItemRevision getRev() {
		return rev;
	}
	public void setRev(TCComponentItemRevision rev) {
		this.rev = rev;
	}
	public TCComponentItemRevision getpRev() {
		return pRev;
	}
	public Map<TCComponentItemRevision, List<BomValBean>> getBomValMap() {
		return bomValMap;
	}
	public void setBomValMap(Map<TCComponentItemRevision, List<BomValBean>> bomValMap) {
		this.bomValMap = bomValMap;
	}
	public void setpRev(TCComponentItemRevision pRev) {
		this.pRev = pRev;
	}
//	public String getBl_plmxml_abs_xform() {
//		return bl_plmxml_abs_xform;
//	}
//	public void setBl_plmxml_abs_xform(String bl_plmxml_abs_xform) {
//		this.bl_plmxml_abs_xform = bl_plmxml_abs_xform;
//	}
	
	public String getDbom() {//0
		return dbom;
	}
	public void setDbom(String dbom) {//0
		this.dbom = dbom;
		setValueAt(DBOM, dbom);
	}
	public String getEbom() {//1
		return ebom;
	}
	public void setEbom(String ebom) {//1
		this.ebom = ebom;
		setValueAt(EBOM, ebom);
	}
	public String getLabel() {//2
		return label;
	}
	public void setLabel(String label) {//2
		this.label = label;
		setValueAt(LABEL, label);
	}
//	public String getEbomId() {//3
//		return ebomId;
//	}
//	public void setEbomId(String ebomId) {//3
//		this.ebomId = ebomId;
//	}
//	public String getEbomDesc() {//4
//		return ebomDesc;
//	}
//	public void setEbomDesc(String ebomDesc) {//4
//		this.ebomDesc = ebomDesc;
//	}
	public String getNum() {//5
		return num;
	}
	public void setNum(String num) {//5
		this.num = num;
	}
	public String getRefreshStatus() {//6
		return refreshStatus;
	}
	public void setRefreshStatus(String refreshStatus) {//6
		this.refreshStatus = refreshStatus;
		setValueAt(STATUS, refreshStatus);
	}
	public String getParentString() {//7
		return parentString;
	}
	public void setParentString(String parentString) {//7
		this.parentString = parentString;
		setValueAt(PARENT, parentString);
	}

	public String getValueAt(int i) {
		if(values.containsKey(i))
			return values.get(i);
		return "";
	}
	public void setValueAt(int i, String val) {
		values.put(i, val);
	}
	
	public TCComponentBOMLine getBom() {
		return bomLine;
	}
	public void setBom(TCComponentBOMLine bomLine) {
		this.bomLine = bomLine;
	}
	
	public String toString() {
		return dbom + "--" + ebom;
	}
}