hypesystem

[C1] - Seat.java

Nov 8th, 2011
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. package cinemabooking;
  2.  
  3. /**
  4.  *
  5.  * @author hypesystem
  6.  */
  7. public class Seat {
  8.     private int x, y;
  9.     private boolean is_booked;
  10.    
  11.     public Seat(int x, int y, boolean is_booked) {
  12.         this.x = x;
  13.         this.y = y;
  14.         this.is_booked = is_booked;
  15.     }
  16.    
  17.     public int getX() {
  18.         return x;
  19.     }
  20.    
  21.     public int getY() {
  22.         return y;
  23.     }
  24.    
  25.     public boolean isBooked() {
  26.         return is_booked;
  27.     }
  28.    
  29.     @Override
  30.     public String toString() {
  31.         String bkd = "AVAIL";
  32.         if(isBooked()) bkd = "BOOKD";
  33.         return "SeatR"+x+"S"+y+bkd;
  34.     }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment