1 2 5 14 package org.jacorb.trading.constraint; 15 16 import java.io.*; 17 18 19 20 public class InNode extends ExprNode 21 { 22 private ExprNode m_left; 23 private ExprNode m_right; 24 25 26 private InNode() 27 { 28 } 29 30 31 public InNode(ExprNode left, ExprNode right) 32 { 33 m_left = left; 34 m_right = right; 35 36 setType(new ValueType(ValueType.BOOLEAN)); 37 } 38 39 40 public void print(PrintStream ps) 41 { 42 ps.println("InNode: type = " + getType()); 43 ps.println("Left node:"); 44 m_left.print(ps); 45 ps.println("Right node:"); 46 m_right.print(ps); 47 } 48 49 50 public Value evaluate(PropertySource source) 51 throws MissingPropertyException 52 { 53 Value result = null; 54 55 PropertyNode prop = (PropertyNode)m_right; 57 58 Value left = m_left.evaluate(source); 59 60 result = ValueFactory.createBoolean(prop.inSequence(left, source)); 62 63 return result; 64 } 65 } 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | Popular Tags |