KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lsmp > djep > groupJep > groups > Group


1 /* @author rich
2  * Created on 06-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.groups;
9 import org.lsmp.djep.groupJep.*;
10 import org.nfunk.jep.type.*;
11 import org.nfunk.jep.*;
12 /**
13  * Base abstract class for all groups.
14  *
15  * @author Rich Morris
16  * Created on 06-Mar-2004
17  */

18 public abstract class Group implements GroupI {
19     /**
20     * Creates a default NumberFactory which calls
21     * the {@link org.lsmp.djep.groupJep.GroupI#valueOf} method of the subclass
22     * to create strings from numbers.
23     */

24     private NumberFactory NumFac = new NumberFactory() {
25         public Object JavaDoc createNumber(String JavaDoc s) {
26             return valueOf(s);
27         }};
28         
29     /** returns a number factory for creating group elements from strings */
30     public NumberFactory getNumberFactory() { return NumFac; }
31
32     /** adds the standard constants for this group.
33      * By default does nothing. */

34     public void addStandardConstants(JEP j) {}
35     
36     /** adds the standard function for this group
37     * By default does nothing. */

38     public void addStandardFunctions(JEP j) {}
39     
40     public String JavaDoc toString()
41     {
42         return "general group";
43     }
44 }
45
Popular Tags