Author: jawi
Date: Thu Feb 27 08:55:44 2014
New Revision: 1572472
URL: http://svn.apache.org/r1572472
Log:
Added a increment and decrement task.
Modified:
ace/trunk/org.apache.ace.gogo/src/org/apache/ace/gogo/math/MathCommands.java
Modified: ace/trunk/org.apache.ace.gogo/src/org/apache/ace/gogo/math/MathCommands.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.gogo/src/org/apache/ace/gogo/math/MathCommands.java?rev=1572472&r1=1572471&r2=1572472&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.gogo/src/org/apache/ace/gogo/math/MathCommands.java (original)
+++ ace/trunk/org.apache.ace.gogo/src/org/apache/ace/gogo/math/MathCommands.java Thu Feb 27
08:55:44 2014
@@ -23,7 +23,7 @@ import org.apache.felix.service.command.
public class MathCommands {
public final static String SCOPE = "math";
- public final static String[] FUNCTIONS = new String[] { "lt", "gt", "eq" };
+ public final static String[] FUNCTIONS = new String[] { "lt", "gt", "eq", "inc", "dec"
};
@Descriptor("test if first number is greater then second number")
public static boolean gt(long first, long second) {
@@ -39,4 +39,14 @@ public class MathCommands {
public static boolean eq(long first, long second) {
return first == second;
}
+
+ @Descriptor("returns the given number incremented by one")
+ public static long inc(long num) {
+ return num + 1;
+ }
+
+ @Descriptor("returns the given number decremented by one")
+ public static long dec(long num) {
+ return num - 1;
+ }
}
|