ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1572473 - /ace/trunk/org.apache.ace.gogo/src/org/apache/ace/gogo/math/MathCommands.java
Date Thu, 27 Feb 2014 08:57:22 GMT
Author: jawi
Date: Thu Feb 27 08:57:21 2014
New Revision: 1572473

URL: http://svn.apache.org/r1572473
Log:
Added commands to add and substract numbers.


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=1572473&r1=1572472&r2=1572473&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:57:21 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", "inc", "dec"
};
+    public final static String[] FUNCTIONS = new String[] { "lt", "gt", "eq", "inc", "dec",
"add", "sub" };
 
     @Descriptor("test if first number is greater then second number")
     public static boolean gt(long first, long second) {
@@ -49,4 +49,14 @@ public class MathCommands {
     public static long dec(long num) {
         return num - 1;
     }
+
+    @Descriptor("returns the addition of two numbers")
+    public static long add(long a, long b) {
+        return a + b;
+    }
+
+    @Descriptor("returns the difference of two numbers")
+    public static long sub(long a, long b) {
+        return a - b;
+    }
 }



Mime
View raw message