PredicateUtilities.java 1.1KB

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