package observerPattern;
import java.util.ArrayList;
/*
|==============================================================
|
|--------------------------------------------------------------
|	The EventsOffice is the 'concrete-subject' in this pattern
|--------------------------------------------------------------
|
|==============================================================
|
*/
public class EventsOffice implements Administrator {
	String city,venue;
	int price;
	ArrayList<User> observer;
	public EventsOffice(){
		observer = new ArrayList<>();
	}
	public void registerUser(User user) {
		observer.add(user);

	}

	@Override
	public void removeUser(User user) {
		observer.remove(user);

	}

	@Override
	public void notifyUser() {
		for (int i = 0; i < observer.size(); i++) {
			User ob = (User) observer.get(i);
			ob.update(city, price,venue);
		}
	}
	public void sendConferenceDetails(){
		notifyUser();
	}

	public void setNewConferenceDetails(String conferenceCity, int conferencePrice, String conferenceVenue){
		this.city = conferenceCity;
		this.price = conferencePrice;
		this.venue = conferenceVenue;
		sendConferenceDetails();
		displayConferenceDetails();
	}
	public void displayConferenceDetails(){
		System.out.println("Location: "+this.city+"\nPrice: "+price+"\nVenue: "+venue);
	}

}

@@ -542,24 +542,26 @@
 ist%3C%3E();%0A%09%7D%0A
+%09%0A
 %09public void
@@ -601,33 +601,32 @@
 rver.add(user);%0A
-%0A
 %09%7D%0A%0A%09@Override%0A%09
@@ -686,17 +686,16 @@
 (user);%0A
-%0A
 %09%7D%0A%0A%09@Ov
@@ -1166,24 +1166,26 @@
 tails();%0A%09%7D%0A
+%09%0A
 %09public void
@@ -1298,11 +1298,10 @@
 ue);%0A%09%7D%0A
-%0A
 %7D%0A

tidy coding style