Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. public class ZodiacTable
  2. {
  3. private ArrayList<Zodiac> zodiacs;
  4. private LocalDate l;
  5.  
  6. public ZodiacTable(LocalDate l)
  7. {
  8. this.zodiacs = new ArrayList();
  9. this.zodiacs.add(new Aquarius(l));
  10. this.zodiacs.add(new Aries(l));
  11. this.zodiacs.add(new Cancer(l));
  12. this.zodiacs.add(new Capricorn(l));
  13. this.zodiacs.add(new Gemini(l));
  14. this.zodiacs.add(new Leo(l));
  15. this.zodiacs.add(new Libra(l));
  16. this.zodiacs.add(new Pisces(l));
  17. this.zodiacs.add(new Sagittarius(l));
  18. this.zodiacs.add(new Scorpio(l));
  19. this.zodiacs.add(new Taurus(l));
  20. this.zodiacs.add(new Virgo(l));
  21.  
  22. this.l = l;
  23. }
  24.  
  25. public Zodiac getSign()
  26. {
  27. for (Zodiac z : this.zodiacs) {
  28. if (z.isBetween(this.l)) {
  29. return z;
  30. }
  31. }
  32. return null;
  33. }
  34.  
  35. public String getSymbol()
  36. {
  37. for (Zodiac z : this.zodiacs) {
  38. if (z.isBetween(this.l)) {
  39. return z.zodiacSymbol();
  40. }
  41. }
  42. return null;
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement