Guest User

Dot class

a guest
Jun 19th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. public class Dot {
  2.  
  3.     private boolean isFruit;
  4.     private boolean isBig;
  5.     private boolean isNull;
  6.  
  7.     public Dot (boolean fruit, boolean big) {
  8.         isFruit = fruit;
  9.         isBig = big;
  10.        isNull = false;
  11.     }
  12.  
  13.     public Dot (String str) {
  14.       if (str.equals("empty")){
  15.         isNull = true;
  16.       }
  17.     }
  18.       public boolean isNull () {
  19.         return isNull;
  20.       }
  21.        
  22.     public boolean isFruit () {
  23.         return isFruit;
  24.     }
  25.  
  26.     public boolean isBig () {
  27.         return isBig;
  28.     }
  29.    
  30.    public boolean isLittleDot() {
  31.      return !isFruit() && !isBig();
  32.    }
  33.  
  34.    public boolean isBigDot() {
  35.      return !isFruit() && isBig();
  36.    }
  37.    
  38.    public boolean isFruitDot() {
  39.      return isFruit() && !isBig();
  40.    }
  41.  
  42. }
Add Comment
Please, Sign In to add comment