KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lsmp > djep > groupJep > GroupI


1 /* @author rich
2  * Created on 05-Mar-2004
3  *
4  * This code is covered by a Creative Commons
5  * Attribution, Non Commercial, Share Alike license
6  * <a HREF="http://creativecommons.org/licenses/by-nc-sa/1.0">License</a>
7  */

8 package org.lsmp.djep.groupJep;
9 import org.nfunk.jep.type.*;
10 import org.nfunk.jep.*;
11 /**
12  * Represents a group with an identity, and addition operator.
13  *
14  * @author Rich Morris
15  * Created on 05-Mar-2004
16  */

17 public interface GroupI {
18     /** Returns the identity element under + */
19     public Number JavaDoc getZERO();
20     /** Get Inverse of a number */
21     public Number JavaDoc getInverse(Number JavaDoc num);
22     /** Get sum of the numbers */
23     public Number JavaDoc add(Number JavaDoc a,Number JavaDoc b);
24     /** Get the difference of the numbers.
25      * i.e. a + (-b) */

26     public Number JavaDoc sub(Number JavaDoc a,Number JavaDoc b);
27     /** whether two numbers are equal */
28     public boolean equals(Number JavaDoc a,Number JavaDoc b);
29     /** returns number given by the string */
30     public Number JavaDoc valueOf(String JavaDoc s);
31     /** returns a number factory for creating group elements from strings.
32      * Most groups which are subclasses of {@link org.lsmp.djep.groupJep.groups.Group Group} do not need to
33      * implement this method. */

34     public NumberFactory getNumberFactory();
35     /** adds the standard constants for this group */
36     public void addStandardConstants(JEP j);
37     /** adds the standard function for this group */
38     public void addStandardFunctions(JEP j);
39 }
40
Popular Tags