public void Visit(ConstraintNode constraintNode)
        {
            //XMLPrinterVisitor xml = new XMLPrinterVisitor(Console.Out);
            //constraintNode.Accept(xml);

            if(constraintNode.isNormalized()) {
                newConstraintNodes.Add(constraintNode);
            } else {
                if(constraintNode.on.type == AssignmentNode.AssignmentType.EqualTo && !constraintNode.bn.varNode.sb) {
                    String json = jss.Serialize(constraintNode);
                    ConstraintNode copy = jss.Deserialize<ConstraintNode>(json);
                    constraintNode.on.type = AssignmentNode.AssignmentType.GreaterThanOrEqualTo;
                    copy.on.type = AssignmentNode.AssignmentType.GreaterThanOrEqualTo;
                    copy.makeNegative();
                    newConstraintNodes.Add(copy);
                }
                if(constraintNode.on.type == AssignmentNode.AssignmentType.NotEqualTo) {
                    String json = jss.Serialize(constraintNode);
                    ConstraintNode copy = jss.Deserialize<ConstraintNode>(json);
                    constraintNode.on.type = AssignmentNode.AssignmentType.GreaterThan;
                    copy.on.type = AssignmentNode.AssignmentType.GreaterThan;
                    copy.makeNegative();
                    newConstraintNodes.Add(copy);
                }
                if(constraintNode.on.type == AssignmentNode.AssignmentType.LessThanOrEqualTo) {
                    constraintNode.on.type = AssignmentNode.AssignmentType.GreaterThanOrEqualTo;
                    constraintNode.makeNegative();
                }
                if(constraintNode.on.type == AssignmentNode.AssignmentType.LessThan) {
                    constraintNode.on.type = AssignmentNode.AssignmentType.GreaterThan;
                    constraintNode.makeNegative();
                }
                newConstraintNodes.Add(constraintNode);
            }
        }
        public void Visit(ConstraintNode constraintNode)
        {
            if(rm == null) {
                rm = dm.createRow(tm);
                if(rm == null) {
                    throw new Exception("Error Creating Row: ");
                }
            }

            string dataField = jss.Serialize(constraintNode);
            ConstraintModel cm = dm.createConstraint(rm, dataField);
            if(cm == null) {
                throw new Exception("Error Creating Constraint: " + dataField);
            }
        }
示例#3
0
 public void addConstraint(ConstraintNode con)
 {
     constraintNodes.Add(con);
 }
示例#4
0
 public void Visit(ConstraintNode constraintNode)
 {
     PrintLine("<constraint>");
     indent();
     constraintNode.en.Accept(this);
     constraintNode.on.Accept(this);
     constraintNode.bn.Accept(this);
     unindent();
     PrintLine("</constraint>");
 }
示例#5
0
 public void Visit(ConstraintNode constraintNode)
 {
     throw new NotImplementedException ();
 }
示例#6
0
 public void Visit(ConstraintNode constraintNode)
 {
     constraintNode.en.Accept(this);
     constraintNode.on.Accept(this);
     constraintNode.bn.Accept(this);
 }