001    package railo.runtime.interpreter.ref.op;
002    
003    import railo.runtime.exp.PageException;
004    import railo.runtime.interpreter.ref.Ref;
005    import railo.runtime.interpreter.ref.RefSupport;
006    import railo.runtime.op.Caster;
007    
008    /**
009     * Plus operation
010     */
011    public final class Mod extends RefSupport implements Ref {
012    
013        private Ref right;
014        private Ref left;
015    
016        /**
017         * constructor of the class
018         * @param left
019         * @param right
020         */
021        public Mod(Ref left, Ref right) {
022            this.left=left;
023            this.right=right;
024        }
025    
026        /**
027         * @see railo.runtime.interpreter.ref.Ref#getValue()
028         */
029        public Object getValue() throws PageException {
030            return new Double(Caster.toDoubleValue(left.getValue())%Caster.toDoubleValue(right.getValue()));
031        }
032    
033        /**
034         * @see railo.runtime.interpreter.ref.Ref#getTypeName()
035         */
036        public String getTypeName() {
037            return "operation";
038        }
039    
040    }