/*****************************************************
 * jr generated file
 ****************************************************/
import java.lang.*;
import java.io.*;
import edu.ucdavis.jr.*;
import edu.ucdavis.jr.jrx.*;
import java.rmi.*;
import java.io.Serializable;

public class Cap_voidTovoid extends Cap implements Cloneable, Serializable, QuiescentCap
{
    public static Cap_voidTovoid noop = new Cap_voidTovoid(true);
    private Op_voidTovoid.JRProxyOp theop;
    private static int capnum = 0;
    public Cap_voidTovoid()
    {}
    private Cap_voidTovoid(boolean noop)
    {
	super();
	this.is_noop = noop;
    }
    public Cap_voidTovoid(Op_voidTovoid.JRProxyOp theop)
    {
	super();
	this.theop = theop;
    }
    public void call(long JRtimestamp)

    {
	if (is_noop)
	    return;
	this.theop.call(JRtimestamp);
    }
    public Cap_voidTovoid cocall(long JRtimestamp)

    {
	try {
	if (is_noop) {
		Op_voidTovoid.JRProxyOp myretOp = new Op_voidTovoid.JRProxyOp(new InOp_voidTovoid_impl());
		myretOp.send(jrvm.getTimestamp());
		return new Cap_voidTovoid(myretOp);
	}
;
	return this.theop.cocall(JRtimestamp);
	 } catch (RemoteException re) {throw new edu.ucdavis.jr.jrCommunicationException(re); }
    }
    public Cap_voidTovoid cocall(long JRtimestamp, edu.ucdavis.jr.RemoteHandler handler, Cap_voidTovoid fretOp)
    {
	try {
	if (is_noop) {
		Op_voidTovoid.JRProxyOp myretOp = new Op_voidTovoid.JRProxyOp(new InOp_voidTovoid_impl());
		myretOp.send(jrvm.getTimestamp(), handler);
		return new Cap_voidTovoid(myretOp);
	}
;
	return this.theop.cocall(JRtimestamp, handler, fretOp);
	 } catch (RemoteException re) {throw new edu.ucdavis.jr.jrCommunicationException(re); }
    }
    public void send(long JRtimestamp, edu.ucdavis.jr.RemoteHandler handler)    {
	send(JRtimestamp, null, handler, null);
    }
    public void send(long JRtimestamp, Op_voidTovoid.JRProxyOp retOp, edu.ucdavis.jr.RemoteHandler handler, Exception e)
    {
	if (is_noop)
	    return;
	this.theop.send(JRtimestamp, retOp, handler, e);
    }
    public Cap_voidTovoid cosend(long JRtimestamp, edu.ucdavis.jr.RemoteHandler handler)    {
	return cosend(JRtimestamp, null, handler, null);
    }
    public Cap_voidTovoid cosend(long JRtimestamp, Op_voidTovoid.JRProxyOp retOp, edu.ucdavis.jr.RemoteHandler handler, Exception e)
    {
	try {
	if (is_noop) {
		Op_voidTovoid.JRProxyOp myretOp = new Op_voidTovoid.JRProxyOp(new InOp_voidTovoid_impl());
		myretOp.send(jrvm.getTimestamp());
		return new Cap_voidTovoid(myretOp);
	}
	return this.theop.cosend(JRtimestamp, retOp, handler, e);
	 } catch (RemoteException re) { throw new edu.ucdavis.jr.jrCommunicationException(re); }
    }
    public Recv_voidTovoid recv()
    {
	if (is_noop)
	{
	    jrvm.threadDeath();
	    while (true) Thread.yield();
	}
	return this.theop.recv();
    }
    public int length()
    {
	if (is_noop)
	    return 0;
	return this.theop.length();
    }
    public long getFirstTime()
    {
	if (is_noop)
	    return -1;
	return this.theop.getFirstTime();
    }
    public InLock getLock()
    {
	try {
	if (is_noop)
	    return new InLock_impl(jrvm.thisVM.getName(), false);
	} catch (RemoteException e) { throw new edu.ucdavis.jr.jrCommunicationException(e); }
	return this.theop.getLock();
    }
    public InOpIterator elements()
    {
	try {
	if (is_noop)
	    return new InOpIterator_impl(new InOpIteratorRemote_impl());
	} catch (RemoteException e) { throw new edu.ucdavis.jr.jrCommunicationException(e); }
	return this.theop.elements();
    }
    public boolean isRemote(String site)
    {
	if (is_noop)
	    return false;
	return this.theop.isRemote(site);
    }
    public boolean isCap(int cap)
    {
	return cap == this.capnum;
    }
    public Object getCap(int cap)
    {
	return this;
    }
    public Object getOp()
    {
	return theop;
    }
    public Object clone()
    {
	try
	{
	    Cap_voidTovoid obj = (Cap_voidTovoid)super.clone();
	    obj.theop = this.theop;
	    return obj;
	}
	catch (CloneNotSupportedException e)
	{
	    throw new jrRuntimeError(e.toString());
	}
    }
}
