implement a whole bunch of simple methods.

PredicateUtilities.java 966B

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