Strumenti Utente

Strumenti Sito


lpr-b:ccremoto
package ccRMI;
 
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
 
public class CC extends UnicastRemoteObject implements InterfacciaCC {
 
 
	private static final long serialVersionUID = 1L;
 
	private long cc = 0L;
 
	protected CC() throws RemoteException {
		super();
	}
 
	public synchronized long prelievo(long quanto) throws RemoteException {
		if(quanto <= cc) {
			cc -= quanto;
			return (cc);
		} else 
			return -cc;
	}
 
	public synchronized long saldo() throws RemoteException {
		return cc;
	}
 
	public synchronized long versa(long quanto) throws RemoteException {
		cc += quanto;
		return cc;
	}
 
}
lpr-b/ccremoto.txt · Ultima modifica: 07/12/2007 alle 10:01 (17 anni fa) da Marco Danelutto

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki