01: /*
02: * $Id: EvaluationAssembler.java,v 1.1 2003/08/19 01:12:57 jonesde Exp $
03: *
04: * Copyright (c) 1999 Steven J. Metsker.
05: * Copyright (c) 2001 The Open For Business Project - www.ofbiz.org
06: *
07: * Permission is hereby granted, free of charge, to any person obtaining a
08: * copy of this software and associated documentation files (the "Software"),
09: * to deal in the Software without restriction, including without limitation
10: * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11: * and/or sell copies of the Software, and to permit persons to whom the
12: * Software is furnished to do so, subject to the following conditions:
13: *
14: * The above copyright notice and this permission notice shall be included
15: * in all copies or substantial portions of the Software.
16: *
17: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
22: * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
23: * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24: */
25:
26: package org.ofbiz.rules.logikus;
27:
28: import org.ofbiz.rules.engine.*;
29: import org.ofbiz.rules.parse.*;
30:
31: /**
32: * Pops two terms, constructs an Evaluation from these terms, and pushes it.
33: *
34: * @author Steven J. Metsker
35: * @version 1.0
36: */
37: public class EvaluationAssembler extends Assembler {
38:
39: /**
40: * Pops two terms, constructs an Evaluation from these terms,
41: * and pushes it.
42: *
43: * @param Assembly the assembly to work on
44: */
45: public void workOn(Assembly a) {
46: Term second = (Term) a.pop();
47: Term first = (Term) a.pop();
48:
49: a.push(new Evaluation(first, second));
50: }
51: }
|