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    /**
010     * Plus operation
011     */
012    public final class And extends RefSupport implements Ref {
013    
014            private Ref right;
015            private Ref left;
016    
017            /**
018             * constructor of the class
019             * @param left
020             * @param right
021             */
022            public And(Ref left, Ref right) {
023                    this.left=left;
024                    this.right=right;
025            }
026    
027            /**
028             * @see railo.runtime.interpreter.ref.Ref#getValue()
029             */
030            public Object getValue() throws PageException {
031                    return (Caster.toBooleanValue(left.getValue()) && Caster.toBooleanValue(right.getValue()))?Boolean.TRUE:Boolean.FALSE;
032            }
033    
034            /**
035             * @see railo.runtime.interpreter.ref.Ref#getTypeName()
036             */
037            public String getTypeName() {
038                    return "operation";
039            }
040    }