All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jedi.example.ProjectEulerClosureFactory Maven / Gradle / Ivy

package jedi.example;

public class ProjectEulerClosureFactory implements IProjectEulerClosureFactory {
	/**
	 * @see jedi.example.ProjectEuler#div
	 */
	public  jedi.functional.Filter2 divFilter2(final java.lang.Integer x) {
		class Closure implements java.io.Serializable, jedi.functional.Filter2 {
			public java.lang.Boolean execute(final jedi.example.ProjectEuler $receiver, final java.lang.Integer y) {
				try {
					return $receiver.div(x, y);
				}
				catch (RuntimeException ex) {
					throw ex;
				}
				catch (Exception ex) {
					throw new jedi.JediException(ex);
				}
			}

			public int hashCode() {
				return (17) * 37 + (x == null ? 0 : x.hashCode());
			}

			public boolean equals(Object obj) {
				if (obj == this) { return true; }
				if (!(obj instanceof Closure)) { return false; }
				return ((Closure) obj).equalsParameters(x);
			}

			private boolean equalsParameters(final java.lang.Integer $x) {
				return ($x == null ? x == null : $x.equals(x));
			}
		}
		return new Closure();
	}
	/**
	 * @see jedi.example.ProjectEuler#div
	 */
	public  jedi.functional.Filter divProxyFilter(final jedi.example.ProjectEuler $receiver, final java.lang.Integer y) {
		class Closure implements java.io.Serializable, jedi.functional.Filter {
			public java.lang.Boolean execute(final java.lang.Integer x) {
				try {
					return $receiver.div(x, y);
				}
				catch (RuntimeException ex) {
					throw ex;
				}
				catch (Exception ex) {
					throw new jedi.JediException(ex);
				}
			}

			public int hashCode() {
				return ((17) * 37 + ($receiver == null ? 0 : $receiver.hashCode())) * 37 + (y == null ? 0 : y.hashCode());
			}

			public boolean equals(Object obj) {
				if (obj == this) { return true; }
				if (!(obj instanceof Closure)) { return false; }
				return ((Closure) obj).equalsParameters($receiver, y);
			}

			private boolean equalsParameters(final jedi.example.ProjectEuler $$receiver, final java.lang.Integer $y) {
				return ($$receiver == null ? $receiver == null : $$receiver.equals($receiver)) && ($y == null ? y == null : $y.equals(y));
			}
		}
		return new Closure();
	}
	/**
	 * @see jedi.example.ProjectEuler#multiply
	 */
	public  jedi.functional.Functor multiplyFunctor(final java.lang.Integer a, final java.lang.Integer b) {
		class Closure implements java.io.Serializable, jedi.functional.Functor {
			public java.lang.Integer execute(final jedi.example.ProjectEuler $receiver) {
				try {
					return $receiver.multiply(a, b);
				}
				catch (RuntimeException ex) {
					throw ex;
				}
				catch (Exception ex) {
					throw new jedi.JediException(ex);
				}
			}

			public int hashCode() {
				return ((17) * 37 + (a == null ? 0 : a.hashCode())) * 37 + (b == null ? 0 : b.hashCode());
			}

			public boolean equals(Object obj) {
				if (obj == this) { return true; }
				if (!(obj instanceof Closure)) { return false; }
				return ((Closure) obj).equalsParameters(a, b);
			}

			private boolean equalsParameters(final java.lang.Integer $a, final java.lang.Integer $b) {
				return ($a == null ? a == null : $a.equals(a)) && ($b == null ? b == null : $b.equals(b));
			}
		}
		return new Closure();
	}
	/**
	 * @see jedi.example.ProjectEuler#multiply
	 */
	public  jedi.functional.Functor2 multiplyProxyFunctor2(final jedi.example.ProjectEuler $receiver) {
		class Closure implements java.io.Serializable, jedi.functional.Functor2 {
			public java.lang.Integer execute(final java.lang.Integer a, final java.lang.Integer b) {
				try {
					return $receiver.multiply(a, b);
				}
				catch (RuntimeException ex) {
					throw ex;
				}
				catch (Exception ex) {
					throw new jedi.JediException(ex);
				}
			}

			public int hashCode() {
				return (17) * 37 + ($receiver == null ? 0 : $receiver.hashCode());
			}

			public boolean equals(Object obj) {
				if (obj == this) { return true; }
				if (!(obj instanceof Closure)) { return false; }
				return ((Closure) obj).equalsParameters($receiver);
			}

			private boolean equalsParameters(final jedi.example.ProjectEuler $$receiver) {
				return ($$receiver == null ? $receiver == null : $$receiver.equals($receiver));
			}
		}
		return new Closure();
	}
	/**
	 * @see jedi.example.ProjectEuler#isPalindrome
	 */
	public  jedi.functional.Filter isPalindromeFilter(final java.lang.Integer x) {
		class Closure implements java.io.Serializable, jedi.functional.Filter {
			public java.lang.Boolean execute(final jedi.example.ProjectEuler $receiver) {
				try {
					return $receiver.isPalindrome(x);
				}
				catch (RuntimeException ex) {
					throw ex;
				}
				catch (Exception ex) {
					throw new jedi.JediException(ex);
				}
			}

			public int hashCode() {
				return (17) * 37 + (x == null ? 0 : x.hashCode());
			}

			public boolean equals(Object obj) {
				if (obj == this) { return true; }
				if (!(obj instanceof Closure)) { return false; }
				return ((Closure) obj).equalsParameters(x);
			}

			private boolean equalsParameters(final java.lang.Integer $x) {
				return ($x == null ? x == null : $x.equals(x));
			}
		}
		return new Closure();
	}
	/**
	 * @see jedi.example.ProjectEuler#isPalindrome
	 */
	public  jedi.functional.Filter isPalindromeProxyFilter(final jedi.example.ProjectEuler $receiver) {
		class Closure implements java.io.Serializable, jedi.functional.Filter {
			public java.lang.Boolean execute(final java.lang.Integer x) {
				try {
					return $receiver.isPalindrome(x);
				}
				catch (RuntimeException ex) {
					throw ex;
				}
				catch (Exception ex) {
					throw new jedi.JediException(ex);
				}
			}

			public int hashCode() {
				return (17) * 37 + ($receiver == null ? 0 : $receiver.hashCode());
			}

			public boolean equals(Object obj) {
				if (obj == this) { return true; }
				if (!(obj instanceof Closure)) { return false; }
				return ((Closure) obj).equalsParameters($receiver);
			}

			private boolean equalsParameters(final jedi.example.ProjectEuler $$receiver) {
				return ($$receiver == null ? $receiver == null : $$receiver.equals($receiver));
			}
		}
		return new Closure();
	}
	/**
	 * @see jedi.example.ProjectEuler#sum
	 */
	public  jedi.functional.Functor sumFunctor(final java.lang.Integer a, final java.lang.Integer b) {
		class Closure implements java.io.Serializable, jedi.functional.Functor {
			public java.lang.Integer execute(final jedi.example.ProjectEuler $receiver) {
				try {
					return $receiver.sum(a, b);
				}
				catch (RuntimeException ex) {
					throw ex;
				}
				catch (Exception ex) {
					throw new jedi.JediException(ex);
				}
			}

			public int hashCode() {
				return ((17) * 37 + (a == null ? 0 : a.hashCode())) * 37 + (b == null ? 0 : b.hashCode());
			}

			public boolean equals(Object obj) {
				if (obj == this) { return true; }
				if (!(obj instanceof Closure)) { return false; }
				return ((Closure) obj).equalsParameters(a, b);
			}

			private boolean equalsParameters(final java.lang.Integer $a, final java.lang.Integer $b) {
				return ($a == null ? a == null : $a.equals(a)) && ($b == null ? b == null : $b.equals(b));
			}
		}
		return new Closure();
	}
	/**
	 * @see jedi.example.ProjectEuler#sum
	 */
	public  jedi.functional.Functor2 sumProxyFunctor2(final jedi.example.ProjectEuler $receiver) {
		class Closure implements java.io.Serializable, jedi.functional.Functor2 {
			public java.lang.Integer execute(final java.lang.Integer a, final java.lang.Integer b) {
				try {
					return $receiver.sum(a, b);
				}
				catch (RuntimeException ex) {
					throw ex;
				}
				catch (Exception ex) {
					throw new jedi.JediException(ex);
				}
			}

			public int hashCode() {
				return (17) * 37 + ($receiver == null ? 0 : $receiver.hashCode());
			}

			public boolean equals(Object obj) {
				if (obj == this) { return true; }
				if (!(obj instanceof Closure)) { return false; }
				return ((Closure) obj).equalsParameters($receiver);
			}

			private boolean equalsParameters(final jedi.example.ProjectEuler $$receiver) {
				return ($$receiver == null ? $receiver == null : $$receiver.equals($receiver));
			}
		}
		return new Closure();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy