implement a whole bunch of simple methods.

PredicateUtilities.java 1023B

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