PredicateUtilities.java 1.0KB

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