Advertisement
Kwintendr

Untitled

Jan 19th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 1.01 KB | None | 0 0
  1. // Dit is voor de klasse Datum:
  2.  
  3. public boolean komtVoor(Datum d){
  4.         if (d.jaar>this.jaar) return true;
  5.         else{
  6.             if ((d.maand>this.maand)&&(d.jaar==this.jaar)) return true;
  7.             else{
  8.                 if((d.dag>this.dag)&&(d.jaar==this.jaar)&&(d.maand==this.maand)) return true;
  9.                 else return false;
  10.             }
  11.         }
  12.     }
  13.  
  14. // Dit is voor de klasse TijdVanDeDag:
  15. private int minuten;
  16.     private int uren;
  17.     private int seconden;
  18.  
  19. public boolean komtVoor(TijdVanDeDag a) {
  20.         if (a.uren>this.uren){
  21.             return true;
  22.         }
  23.         else{
  24.             if ((a.minuten>this.minuten)&&(a.uren==this.uren)) return true;
  25.             else{
  26.                 if((a.seconden>this.seconden)&&(a.uren==this.uren)&&(a.minuten==this.minuten)) return true;
  27.                 else return false;
  28.             }
  29.         }
  30.     }
  31.  
  32. // Dit is voor de klasse tijdstip
  33. private TijdVanDeDag tijd;
  34.     private Datum dagen;
  35.  
  36. public boolean komtVoor(Tijdstip t){
  37.         if ((this.dagen).komtVoor(t.dagen)) return true;
  38.         else{
  39.             if(((this.tijd).komtVoor(t.tijd))&&(this.dagen==t.dagen)) return true;
  40.             else return false;
  41.         }
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement