PredicateUtilities.java 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. {
  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 {return false;}
  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. {
  39. return true;
  40. }
  41. else{return false;}
  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. else{return false;}
  52. }
  53. }