package jp.co.denso.fa.jmscaosql.model;

import java.rmi.RemoteException;
import java.util.Date;

import jp.co.denso.fa.jcaosql.CaoSQLItem;
import jp.co.denso.fa.jcaosql.ComInterfaceException;
import jp.co.denso.fa.jcaosql.UnsupportedTypeException;

/**
 * <code>CaoSqlItemModel</code> は CaoSQLにおける <code>ICaoSQLItem</code>
 * と対応するjavaオブジェクト
 *
 * @author DENSO WAVE
 * @version 1.00
 */
public class CaoSQLItemModel {

	private boolean activation;
	private long attribute;
	private Date dateTime;
	private String description;
	private Object elements;
	private long index;
	private boolean linkActivation;
	private String[] linkItemNames;
	private long microsecond;
	private String name;
	private Object settingData;
	private long state;
	private Object tag;
	private Object value;
	private Object valueEx;

	public CaoSQLItemModel() {

	}

	/**
	 * コンストラクタ
	 *
	 * @param activation
	 * @param attribute
	 * @param dateTime
	 * @param description
	 * @param elements
	 * @param index
	 * @param linkActivation
	 * @param linkItemNames
	 * @param microsecond
	 * @param name
	 * @param settingData
	 * @param state
	 * @param tag
	 * @param value
	 * @param valueEx
	 */
	public CaoSQLItemModel(boolean activation, long attribute, Date dateTime, String description, Object elements,
			long index, boolean linkActivation, String[] linkItemNames, long microsecond, String name,
			Object settingData, long state, Object tag, Object value, Object valueEx) {
		super();
		this.activation = activation;
		this.attribute = attribute;
		this.dateTime = dateTime;
		this.description = description;
		this.elements = elements;
		this.index = index;
		this.linkActivation = linkActivation;
		this.linkItemNames = linkItemNames;
		this.microsecond = microsecond;
		this.name = name;
		this.settingData = settingData;
		this.state = state;
		this.tag = tag;
		this.value = value;
		this.valueEx = valueEx;
	}

	public  CaoSQLItemModel(CaoSQLItem item) {

		try {
			this.activation = item.getActivation();
			this.attribute = item.getAttribute();
			this.dateTime = item.getDateTime();
			this.description = item.getDescription();
			// this.elements = item.get;
			this.index = item.getIndex();
			this.linkActivation = item.getLinkActivation();
			this.linkItemNames = item.getLinkItemNames();
			// this.microsecond = item.ge();
			this.name = item.getName();
			// this.settingData = item.getSettingData;
			this.state = item.getState();
			this.tag = item.getTag();
			this.value = item.getValue();
			// this.valueEx = item.getValue();
		} catch (ComInterfaceException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (UnsupportedTypeException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
	}

	public CaoSQLItemModel(jp.co.denso.fa.jcaosql.rmi.CaoSQLItem item) {
		try {
			this.activation = item.getActivation();
			this.attribute = item.getAttribute();
			this.dateTime = item.getDateTime();
			this.description = item.getDescription();
			this.index = item.getIndex();
			this.linkActivation = item.getLinkActivation();
			this.linkItemNames = item.getLinkItemNames();
			this.name = item.getName();
			this.state = item.getState();
			this.tag = item.getTag();
			this.value = item.getValue();
			// this.valueEx = item.getValue();
		} catch (ComInterfaceException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (UnsupportedTypeException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (RemoteException e) {
			e.printStackTrace();
		}
	}

	public boolean isActivation() {
		return activation;
	}

	public void setActivation(boolean activation) {
		this.activation = activation;
	}

	public long getAttribute() {
		return attribute;
	}

	public void setAttribute(long attribute) {
		this.attribute = attribute;
	}

	public Date getDateTime() {
		return dateTime;
	}

	public void setDateTime(Date dateTime) {
		this.dateTime = dateTime;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Object getElements() {
		return elements;
	}

	public void setElements(Object elements) {
		this.elements = elements;
	}

	public long getIndex() {
		return index;
	}

	public void setIndex(long index) {
		this.index = index;
	}

	public boolean isLinkActivation() {
		return linkActivation;
	}

	public void setLinkActivation(boolean linkActivation) {
		this.linkActivation = linkActivation;
	}

	public String[] getLinkItemNames() {
		return linkItemNames;
	}

	public void setLinkItemNames(String[] linkItemNames) {
		this.linkItemNames = linkItemNames;
	}

	public long getMicrosecond() {
		return microsecond;
	}

	public void setMicrosecond(long microsecond) {
		this.microsecond = microsecond;
	}

	public String getName() {
		return name;
	}

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

	public Object getSettingData() {
		return settingData;
	}

	public void setSettingData(Object settingData) {
		this.settingData = settingData;
	}

	public long getState() {
		return state;
	}

	public void setState(long state) {
		this.state = state;
	}

	public Object getTag() {
		return tag;
	}

	public void setTag(Object tag) {
		this.tag = tag;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public Object getValueEx() {
		return valueEx;
	}

	public void setValueEx(Object valueEx) {
		this.valueEx = valueEx;
	}

}
