PredicateUtilities.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. boolean result;
  12. if(x>y)
  13. return true;
  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. boolean result;
  25. if(x<y)
  26. return true;
  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. boolean result;
  38. if(x>=y)
  39. return true;
  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. boolean result;
  51. if(x<=y)
  52. return true;
  53. else{
  54. return false;
  55. }
  56. }
  57. }