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