
package LRSVisitor;

import LRStructure.*;
public class GetLast
	implements IAlgo
{
	/** @SBGen Singleton Variable   */
	private static GetLast singleton = null;

	/** @SBGen Singleton   */
	public static GetLast Singleton()
	{
		// SBgen: Ensure single instance
		if (singleton == null) 
			singleton = new GetLast();
		return(singleton);
		// SBgen: End singleton
	}
	/** @SBGen Constructor   */
	private GetLast()
	{
	}
	public Object nullCase(LRStruct host, Object param)
	{
		return(((LRStruct) param).getFirst());
	}

	public Object nonNullCase(LRStruct host, Object param)
	{
		return(host.getRest().execute(this,host));
	}
}

