// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) fieldsfirst 
// Source File Name:   SimpleSignal.java

package drm.signal;


// Referenced classes of package drm.signal:
//			Signal

public class SimpleSignal
	implements Signal
{

	protected Object value;
	protected long step;

	public SimpleSignal()
	{
		value = null;
		step = 0L;
	}

	public SimpleSignal(Object value)
	{
		this.value = null;
		step = 0L;
		setValue(value);
	}

	public void setStep(long step)
	{
		this.step = step;
	}

	public long getStep()
	{
		return step;
	}

	public long incStep()
	{
		return ++step;
	}

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

	public Object getValue()
	{
		return value;
	}

	public boolean equals(Signal s)
	{
		if(s == null)
			return false;
		if(value == null)
			return s.getValue() == null;
		else
			return value.equals(s.getValue());
	}

	public Signal copy()
	{
		Signal s = null;
		try
		{
			s = (Signal)getClass().newInstance();
			s.setStep(step);
			s.setValue(value);
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
		return s;
	}

	public String toString()
	{
		String val = "null";
		if(value != null)
			val = value.toString();
		return "step:" + String.valueOf(step) + ",value:" + val;
	}
}
