Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. import java.util.Observable;
  2. import java.util.Observer;
  3.  
  4. public class Event extends Observable{
  5. private string name;
  6. private string description;
  7. private Calendar date;
  8. private int minNoTickets;
  9. private string genre; //derived shit how to code ah?
  10. private bool visibility;
  11. private int maxTicket;
  12. private EventState eventState;
  13. private bool detailsFinalized;
  14.  
  15. public void setVisibility(bool visibility){ //method name?
  16. if(visiblitity == true){
  17. setChanged();
  18. notifyObservers();
  19. }
  20. }
  21.  
  22. import java.util.ArrayList;
  23.  
  24. public class RegisteredCustomer implements Observer{
  25. private ArrayList eventList; //name of arraylist to store events?
  26.  
  27. public void Announce(Observable obs){ //name of method to add event?
  28. eventList.add(obs);
  29. obs.addObserver(this);
  30. //do we need to change visibility status of event?
  31. }
  32.  
  33. public void update(Observable obs, Object arg){
  34. if(obs instanceOf Game){
  35. bool visibility = ((Event)obs).getVisibility();
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement