public ZNode load(File file) { apiFactory = zfactory.getApiFactory(file); log.info("api=" + apiFactory); final ZNode node = new ZCodeLoader(apiFactory).load(file); selectedNode = node; return node; }
/** * This function extracts from a SetExpr that contains the values of a binary relation, the values * in the range of the relation * * @param setValues The set with the values in the relation * @return the values in the range */ public static SetExpr extractRanValues(SetExpr setValues) { ZFactory zFactory = new ZFactoryImpl(); SetExpr ranSetExpr = zFactory.createSetExpr(); ZExprList zRanList = zFactory.createZExprList(); ZExprList originalZList = setValues.getZExprList(); for (int i = 0; i < originalZList.size(); i++) { Expr auxExpr = originalZList.get(i); if (auxExpr instanceof TupleExpr) { TupleExpr tupleExpr = (TupleExpr) auxExpr; ZExprList zTupList = tupleExpr.getZExprList(); if (zTupList.size() == 2) { Expr ranExpr = zTupList.get(1); zRanList.add(ranExpr); } else { } } } ranSetExpr.setExprList(zRanList); return ranSetExpr; }