@Override public List<String> getLHSBoundFacts() { return model.getLHSBoundFacts(); }
@Override public List<String> getLHSBoundFacts() { return model.getLHSBoundFacts(); }
@Override public List<String> getLHSBoundFacts() { final Set<String> facts = new HashSet<>(); for (CompositeColumn<? extends BaseColumn> col : dtable.getConditions()) { if (col instanceof Pattern52) { final Pattern52 p = (Pattern52) col; if (p.isBound()) { facts.add(p.getBoundName()); } } else if (col instanceof BRLConditionColumn) { //Delegate to super class's implementation final RuleModel rm = new RuleModel(); final BRLConditionColumn brl = (BRLConditionColumn) col; rm.lhs = brl.getDefinition().toArray(new IPattern[brl.getDefinition().size()]); facts.addAll(rm.getLHSBoundFacts()); } } facts.addAll(super.getLHSBoundFacts()); return new ArrayList<>(facts); }
void addGlobalCollections() { List<String> vars = model.getLHSBoundFacts(); if (vars.size() == 0) { return; } if (oracle.getGlobalCollections().length == 0) { return; } choices.addItem(SECTION_SEPARATOR); for (String bf : vars) { for (int i = 0; i < oracle.getGlobalCollections().length; i++) { final String glob = oracle.getGlobalCollections()[i]; final String var = bf; choices.addItem(GuidedRuleEditorResources.CONSTANTS.Append0ToList1(var, glob), "GLOBCOL" + glob + var); cmds.put("GLOBCOL" + glob + var, new Command() { public void execute() { ActionGlobalCollectionAdd gca = new ActionGlobalCollectionAdd(); gca.setGlobalName(glob); gca.setFactName(var); model.addRhsItem(gca, Integer.parseInt(positionCbo.getValue(positionCbo.getSelectedIndex()))); hide(); } }); } } }
void addGlobalCollections() { List<String> vars = model.getLHSBoundFacts(); if (vars.size() == 0) { return; } if (oracle.getGlobalCollections().length == 0) { return; } choices.addItem(SECTION_SEPARATOR); for (String bf : vars) { for (int i = 0; i < oracle.getGlobalCollections().length; i++) { final String glob = oracle.getGlobalCollections()[i]; final String var = bf; choices.addItem(GuidedRuleEditorResources.CONSTANTS.Append0ToList1(var, glob), "GLOBCOL" + glob + var); cmds.put("GLOBCOL" + glob + var, new Command() { public void execute() { ActionGlobalCollectionAdd gca = new ActionGlobalCollectionAdd(); gca.setGlobalName(glob); gca.setFactName(var); model.addRhsItem(gca, Integer.parseInt(positionCbo.getValue(positionCbo.getSelectedIndex()))); hide(); } }); } } }