Menu

DecisionTable: create a default decision table layout

Create a default decision table layout on given condition stubs, condition entries and action stubs.

/**
    *@author: Yan Tang, VUB, 2009
*/

public static void getTableLayoutTest() {
    DecisionTable dt = new DecisionTable();
    Vector<String> conEntries = new Vector<String>();
    conEntries.add("Yes");
    conEntries.add("No");
    conEntries.add(" ");
    DTCondition con1 = new DTCondition("c1", conEntries);
    DTCondition con2 = (new DTCondition("c2", conEntries));
    dt.addCondition(con1);
    dt.addCondition(con2);
    dt.addActionStub("a1");
    dt.addActionStub("a2");

    String[][] content = dt.getTableLayout();
    for (int i = 0; i < content.length; i++) {
        for (int j = 0; j < content[i].length; j++) {
            System.out.print(content[i][j] + ",");
        }
        System.out.println();
    }
}
Posted by Yan Tang Demey 2012-10-18 Labels: decision table

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.