implement a whole bunch of simple methods.

PredicateUtilities.java 908B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Created by dan on 6/14/17.
  3. */
  4. public class PredicateUtilities {
  5. /**
  6. * @param x
  7. * @param y
  8. * @return true if `x` is greater than `y`
  9. */
  10. public Boolean isGreaterThan(int x, int y) {
  11. if (x > y){
  12. return true;
  13. } else{
  14. return false;
  15. }
  16. }
  17. /**
  18. * @param x
  19. * @param y
  20. * @return true if `x` is less than `y`
  21. */
  22. public Boolean isLessThan(int x, int y) {
  23. if (x < y);
  24. return false;
  25. }
  26. /**
  27. * @param x
  28. * @param y
  29. * @return true if `x` is greater than or equal to `y`
  30. */
  31. public Boolean isGreaterThanOrEqualTo(int x, int y) {
  32. if (x >= y){
  33. return true;
  34. } else{
  35. return false;
  36. }
  37. }
  38. /**
  39. * @param x
  40. * @param y
  41. * @return true if `x` is less than or equal to `y`
  42. */
  43. public Boolean isLessThanOrEqualTo(int x, int y) {
  44. if (x <= y);
  45. return true;
  46. }
  47. }