implement a whole bunch of simple methods.

PredicateUtilities.java 1.1KB

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