package cn.com.origin.autocode.classification.panels;


public class ClassificationTreeData {

	private String id = "";
	private String name = "";
	private String type = "";
	private ClassificationTreeData parentTreeNode;
	private ClassificationTreeData[] childrenTreeNodes;

	public ClassificationTreeData() {
	}

	public ClassificationTreeData(String id, String name, String type, ClassificationTreeData parentTreeNode, ClassificationTreeData[] childrenTreeNodes) {
		this.id = id;
		this.name = name;
		this.type =type;
		this.parentTreeNode = parentTreeNode;
		this.childrenTreeNodes = childrenTreeNodes;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public ClassificationTreeData getParentTreeNode() {
		return parentTreeNode;
	}

	public void setParentTreeNode(ClassificationTreeData parentTreeNode) {
		this.parentTreeNode = parentTreeNode;
	}

	public ClassificationTreeData[] getChildrenTreeNodes() {
		return childrenTreeNodes;
	}

	public void setChildrenTreeNodes(ClassificationTreeData[] childrenTreeNodes) {
		this.childrenTreeNodes = childrenTreeNodes;
	}
	public void addChildrenTreeNodes(ClassificationTreeData childrenTreeNode) {
		if (childrenTreeNode == null) {
			return;
		}
		ClassificationTreeData[] childrenNodes = this.childrenTreeNodes;
		int childrenLength = 1;
		if (childrenNodes != null) {
			childrenLength = childrenLength + childrenNodes.length;
		}
		ClassificationTreeData[] childrenNodes2 = new ClassificationTreeData[childrenLength];
		for (int i = 0; i < childrenLength - 1; i++) {
			childrenNodes2[i] = childrenNodes[i];
		}
		childrenNodes2[childrenLength - 1] = childrenTreeNode;
		this.setChildrenTreeNodes(childrenNodes2);
	}
}
