implement a whole bunch of simple methods.

PredicateUtilities.java 1023B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. }
  14. else {
  15. return false;
  16. }
  17. }
  18. /**
  19. * @param x
  20. * @param y
  21. * @return true if `x` is less than `y`
  22. */
  23. public Boolean isLessThan(int x, int y) {
  24. if (x < y){
  25. return true;
  26. }
  27. else {
  28. return false;
  29. }
  30. }
  31. /**
  32. * @param x
  33. * @param y
  34. * @return true if `x` is greater than or equal to `y`
  35. */
  36. public Boolean isGreaterThanOrEqualTo(int x, int y) {
  37. if (x >= y) {
  38. return true;
  39. }
  40. else {
  41. return false;
  42. }
  43. }
  44. /**
  45. * @param x
  46. * @param y
  47. * @return true if `x` is less than or equal to `y`
  48. */
  49. public Boolean isLessThanOrEqualTo(int x, int y) {
  50. if (x <= y) {
  51. return true;
  52. }
  53. else {
  54. return false;
  55. }
  56. }
  57. }