Created
October 21, 2012 16:09
-
-
Save fakedrake/3927374 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseOperator<T> implements IOperator<T> { | |
public T operate(T x, T y) {} | |
public boolean apply (Stack<T> stack) { | |
try { | |
T x = stack.pop(); | |
T y = stack.pop(); | |
} catch (EmptyStackException e) { | |
System.out.println("Stack has to few arguments, you cant operate on it."); | |
return false; | |
} | |
stack.push(operate); | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment