View Javadoc

1   // RelationProblem.java, created Jul 3, 2004 1:44:46 PM by joewhaley
2   // Copyright (C) 2004 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package net.sf.bddbddb.dataflow;
5   
6   import java.util.HashMap;
7   import java.util.Map;
8   import jwutil.util.Assert;
9   import net.sf.bddbddb.ir.Operation;
10  
11  /***
12   * RelationProblem
13   * 
14   * @author John Whaley
15   * @version $Id: OperationProblem.java 328 2004-10-16 02:45:30Z joewhaley $
16   */
17  public abstract class OperationProblem extends Problem {
18      Map/* <Operation,OperationFact> */operationFacts;
19  
20      public OperationProblem() {
21          this.initialize();
22      }
23  
24      public void initialize() {
25          operationFacts = new HashMap();
26      }
27  
28      public OperationFact getFact(Operation o) {
29          return (OperationFact) operationFacts.get(o);
30      }
31  
32      public void setFact(Operation o, OperationFact f) {
33          Assert._assert(f.getOperation() == o);
34          operationFacts.put(o, f);
35          //System.out.println("Setting operation "+o+" to "+f);
36      }
37  
38      public abstract boolean direction();
39      public static interface OperationFact extends Fact {
40          public Operation getOperation();
41      }
42      public abstract class OperationTransferFunction extends TransferFunction {
43      }
44  }