PredicateUtilities.java 1.1KB

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