package javacodebook.net.rmi.objectreference;

import java.rmi.*;
/**
 * @author benjamin_rusch
 *
 * AddressImpl implementiert das Remote interface Address.
 * Addressdaten werden in ihr gekapselt. Veränderbar sollen nur 
 * Strasse und Wohnort sein. 
 */
public class AddressImpl implements Address {

	// Attribute der Klasse Address
	private String firstName;
	private String lastName;
	private String street;
	private String city;

	// Konstruktor der Klasse Address, sämtliche Attribute müssen 
	// hier gesetzt werden
	public AddressImpl( String lastName, String firstName,
			String street, String city) {
		this.lastName=lastName;
		this.firstName=firstName;		
		this.street=street;
		this.city=city;
	}
	
	public String getStringRepresentation() throws RemoteException{
		return firstName+" "+lastName+"\n"+street+"\n"+city;
	}

	public void setStreet(String street) throws RemoteException {
		this.street=street;
	}

	public void setCity(String city) throws RemoteException{
		this.city=city;
	}

}
