//#############################################################################
//#                                                                           #
//#  Copyright (C) <2014>  <IMS MAXIMS>                                       #
//#                                                                           #
//#  This program is free software: you can redistribute it and/or modify     #
//#  it under the terms of the GNU Affero General Public License as           #
//#  published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.                      #
//#                                                                           #
//#  You should have received a copy of the GNU Affero General Public License #
//#  along with this program.  If not, see <http://www.gnu.org/licenses/>.    #
//#                                                                           #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file

package ims.admin.vo.lookups;

import ims.framework.cn.data.TreeNode;
import java.util.ArrayList;
import ims.framework.utils.Image;
import ims.framework.utils.Color;

public class EDAttendenceControlType extends ims.vo.LookupInstVo implements TreeNode
{
	private static final long serialVersionUID = 1L;

	public EDAttendenceControlType()
	{
		super();
	}
	public EDAttendenceControlType(int id)
	{
		super(id, "", true);
	}
	public EDAttendenceControlType(int id, String text, boolean active)
	{
		super(id, text, active, null, null, null);
	}
	public EDAttendenceControlType(int id, String text, boolean active, EDAttendenceControlType parent, Image image)
	{
		super(id, text, active, parent, image);
	}
	public EDAttendenceControlType(int id, String text, boolean active, EDAttendenceControlType parent, Image image, Color color)
	{
		super(id, text, active, parent, image, color);
	}
	public EDAttendenceControlType(int id, String text, boolean active, EDAttendenceControlType parent, Image image, Color color, int order)
	{
		super(id, text, active, parent, image, color, order);
	}
	public static EDAttendenceControlType buildLookup(ims.vo.LookupInstanceBean bean)
	{
		return new EDAttendenceControlType(bean.getId(), bean.getText(), bean.isActive());
	}
	public String toString()
	{
		if(getText() != null)
			return getText();
		return "";
	}
	public TreeNode getParentNode()
	{
		return (EDAttendenceControlType)super.getParentInstance();
	}
	public EDAttendenceControlType getParent()
	{
		return (EDAttendenceControlType)super.getParentInstance();
	}
	public void setParent(EDAttendenceControlType parent)
	{
		super.setParentInstance(parent);
	}
	public TreeNode[] getChildren()
	{
		ArrayList children = super.getChildInstances();
		EDAttendenceControlType[] typedChildren = new EDAttendenceControlType[children.size()];
		for (int i = 0; i < children.size(); i++)
		{
			typedChildren[i] = (EDAttendenceControlType)children.get(i);
		}
		return typedChildren;
	}
	public int addChild(TreeNode child)
	{
		if (child instanceof EDAttendenceControlType)
		{
			super.addChild((EDAttendenceControlType)child);
		}
		return super.getChildInstances().size();
	}
	public int removeChild(TreeNode child)
	{
		if (child instanceof EDAttendenceControlType)
		{
			super.removeChild((EDAttendenceControlType)child);
		}
		return super.getChildInstances().size();
	}
	public Image getExpandedImage()
	{
		return super.getImage();
	}
	public Image getCollapsedImage()
	{
		return super.getImage();
	}
	public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
	{
		EDAttendenceControlTypeCollection result = new EDAttendenceControlTypeCollection();
		result.add(ATTEND_CONTROLS);
		result.add(CHART_CONTROLS);
		result.add(INV_BILL_CONTROLS);
		return result;
	}
	public static EDAttendenceControlType[] getNegativeInstances()
	{
		EDAttendenceControlType[] instances = new EDAttendenceControlType[3];
		instances[0] = ATTEND_CONTROLS;
		instances[1] = CHART_CONTROLS;
		instances[2] = INV_BILL_CONTROLS;
		return instances;
	}
	public static String[] getNegativeInstanceNames()
	{
		String[] negativeInstances = new String[3];
		negativeInstances[0] = "ATTEND_CONTROLS";
		negativeInstances[1] = "CHART_CONTROLS";
		negativeInstances[2] = "INV_BILL_CONTROLS";
		return negativeInstances;
	}
	public static EDAttendenceControlType getNegativeInstance(String name)
	{
		if(name == null)
			return null;
		String[] negativeInstances = getNegativeInstanceNames();
		for (int i = 0; i < negativeInstances.length; i++)
		{
			if(negativeInstances[i].equals(name))
				return getNegativeInstances()[i];
		}
		return null;
	}
	public static EDAttendenceControlType getNegativeInstance(Integer id)
	{
		if(id == null)
			return null;
		EDAttendenceControlType[] negativeInstances = getNegativeInstances();
		for (int i = 0; i < negativeInstances.length; i++)
		{
			if(negativeInstances[i].getID() == id)
				return negativeInstances[i];
		}
		return null;
	}
	public int getTypeId()
	{
		return TYPE_ID;
	}
	public static final int TYPE_ID = 1031027;
	public static final EDAttendenceControlType ATTEND_CONTROLS = new EDAttendenceControlType(-2513, "ATTEND_CONTROLS", true, null, null, Color.Default);
	public static final EDAttendenceControlType CHART_CONTROLS = new EDAttendenceControlType(-2514, "CHART_CONTROLS", true, null, null, Color.Default);
	public static final EDAttendenceControlType INV_BILL_CONTROLS = new EDAttendenceControlType(-2515, "INV_BILL_CONTROLS", true, null, null, Color.Default);
}
