001    /*
002     * $Id: AbelianGroupElem.java 1708 2008-02-24 17:28:36Z kredel $
003     */
004    
005    package edu.jas.structure;
006    
007    
008    /**
009     * Abelian group element interface.
010     * Defines the additive methods.
011     * @param <C> element type
012     * @author Heinz Kredel
013     */
014    
015    public interface AbelianGroupElem<C extends AbelianGroupElem<C>> 
016             extends Element<C> {
017    
018    
019        /**
020         * Test if this is zero.
021         * @return true if this is 0, else false.
022         */
023        public boolean isZERO();
024    
025    
026        /**
027         * Signum.
028         * @return the sign of this.
029         */
030        public int signum();
031    
032    
033        /**
034         * Sum of this and S.
035         * @param S
036         * @return this + S.
037         */
038        public C sum(C S);
039        //public <T extends C> T sum(T S);
040    
041    
042        /**
043         * Subtract S from this.
044         * @param S
045         * @return this - S.
046         */
047        public C subtract(C S);
048    
049    
050        /**
051         * Negate this.
052         * @return - this.
053         */
054        public C negate();
055    
056    
057        /**
058         * Absolute value of this.
059         * @return |this|.
060         */
061        public C abs();
062    
063    }