KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JSci > maths > groups > AbelianGroup


1 package JSci.maths.groups;
2
3 /**
4 * This interface defines an abelian group.
5 * @version 1.0
6 * @author Mark Hale
7 */

8 public interface AbelianGroup {
9         /**
10         * Returns the identity element.
11         */

12         Member zero();
13         /**
14         * Returns true if the member is the identity element of this group.
15         * @param g a group member
16         */

17         boolean isZero(Member g);
18         /**
19         * Returns true if one member is the negative of the other.
20         * @param a a group member
21         * @param b a group member
22         */

23         boolean isNegative(Member a, Member b);
24
25         /**
26         * This interface defines a member of an abelian group.
27         */

28         interface Member extends JSci.maths.Member {
29                 /**
30                 * The group composition law.
31                 * @param g a group member
32                 */

33                 Member add(Member g);
34                 /**
35                 * Returns the inverse member.
36                 */

37                 Member negate();
38                 /**
39                 * The group composition law with inverse.
40                 * @param g a group member
41                 */

42                 Member subtract(Member g);
43         }
44 }
45
46
Popular Tags