implement a whole bunch of simple methods.

PredicateUtilities.java 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. {
  13. return true;
  14. }
  15. else
  16. {
  17. return false;
  18. }
  19. }
  20. /**
  21. * @param x
  22. * @param y
  23. * @return true if `x` is less than `y`
  24. */
  25. public Boolean isLessThan(int x, int y) {
  26. Boolean k;
  27. if(x<y)
  28. {
  29. k=true;
  30. }
  31. else
  32. {
  33. k=false;
  34. }
  35. return k;
  36. }
  37. /**
  38. * @param x
  39. * @param y
  40. * @return true if `x` is greater than or equal to `y`
  41. */
  42. public Boolean isGreaterThanOrEqualTo(int x, int y) {
  43. if(x>=y)
  44. {
  45. return true;
  46. }
  47. else
  48. {
  49. return false;
  50. }
  51. }
  52. /**
  53. * @param x
  54. * @param y
  55. * @return true if `x` is less than or equal to `y`
  56. */
  57. public Boolean isLessThanOrEqualTo(int x, int y) {
  58. if(x<=y)
  59. {
  60. return true;
  61. }
  62. else
  63. {
  64. return false;
  65. }
  66. }
  67. }