Package com.jacobpatterson.csci446.program1.core

Examples of com.jacobpatterson.csci446.program1.core.Cell


                sbWklejka1.append(",");
                sbWklejka2.append(",");
            }
            Column r1Col = inputRelation1.getCol(i);
            Column r2Col = inputRelation2.getCol(i);
            Cell r1Cell1 = r1Col.getCell(1);
            sbWklejka1.append(fillInsert1(r2Col, r1Cell1));
            sbWklejka2.append(fillInsert2(r1Col, r1Cell1));
        }
        Cell g1 = caf.getLeftTopCellInRelation(resultRelation);
        Cell h1 = g1.nextInRow();
        Cell a1 = caf.getLeftTopCellInRelation(inputRelation1);
        formulas.put(g1, fillComparison(sbWklejka1.toString(), sbWklejka2.toString(), a1));
        for (int i = 2; i <= inputRelation1.getCardinality(); i++) {
            a1 = a1.nextInRow();
            formulas.put(h1, fillCopy(g1, a1));
            h1 = h1.nextInRow();
        }

        skipFirstComma = true;
        sbWklejka1 = new StringBuilder();
        sbWklejka2 = new StringBuilder();
        for (int i = 1; i <= inputRelation1.getCardinality(); i++) {
            if (skipFirstComma) {
                skipFirstComma = false;
            } else {
                sbWklejka1.append(",");
                sbWklejka2.append(",");
            }
            Column r1Col = inputRelation1.getCol(i);
            Column r2Col = inputRelation2.getCol(i);
            Cell r1Cell2 = r1Col.getCell(2);
            sbWklejka1.append(fillInsert1(r2Col, r1Cell2));
            sbWklejka2.append(fillInsert2(r1Col, r1Cell2));
        }
        Cell g2 = caf.getLeftTopCellInRelation(resultRelation).nextInColumn();
        Cell h2 = g2.nextInRow();
        Cell a2 = caf.getLeftTopCellInRelation(inputRelation1).nextInColumn();
        formulas.put(g2, fillComparison(sbWklejka1.toString(), sbWklejka2.toString(), a2));
        for (int i = 2; i <= inputRelation1.getCardinality(); i++) {
            a2 = a2.nextInRow();
            formulas.put(h2, fillCopy(g2, a2));
            h2 = h2.nextInRow();
        }
    }
View Full Code Here


            pred = caf.replaceAll(inputRelation, predicate, row);
//            for (int i = 1; i <= inputRelation.getCardinality(); i++) {
//                pred = pred.replaceAll(ESCAPE_SEQ + i, inputRelation.getCol(i).toString(caf)+row);
//            }

            Cell dummyCell = dummyRelation.getFirstCol().getCell(row);
            formulas.put(dummyCell, pred);

            String strDummyCell = dummyCell.toString(caf);
            Cell in = inputRelation.getFirstCol().getCell(row);
            Cell out = resultRelationToStandarize.getFirstCol().getCell(row);
            for (int i = 1; i <= inputRelation.getCardinality(); i++) {
                String strInputCell = inputRelation.getCol(i).getCell(row).toString(caf);
                formulas.put(out, fillIf(strInputCell, strDummyCell, in));
                out = out.nextInRow();
                in = in.nextInRow();
            }
        }

        StandarizationOperator standOper = new StandarizationOperator(caf, resultRelationToStandarize);
View Full Code Here

                sbWklejka1row2.append(",");
                sbWklejka2.append(",");
            }
            Column r1Col = inputRelation1.getCol(i);
            Column r2Col = inputRelation2.getCol(i);
            Cell r1Cell1 = r1Col.getCell(1);
            Cell r1Cell2 = r1Col.getCell(2);
            sbWklejka1row1.append(fillInsert1(r2Col, r1Cell1));
            sbWklejka1row2.append(fillInsert1(r2Col, r1Cell2));
            sbWklejka2.append(fillInsert2(r1Col, r1Cell2));
        }
       
        Cell e1 = caf.getLeftTopCellInRelation(dummyRelation);
        Cell f1 = e1.nextInRow();
        Cell a1 = caf.getLeftTopCellInRelation(inputRelation1);
        formulas.put(e1, fillIf1(a1,sbWklejka1row1.toString()));
        formulas.put(f1, fillMatch(e1.getColumnO()));
               
        Cell gh1 = f1.nextInRow();
        for (int i = 1; i <= inputRelation1.getCardinality(); i++) {
            formulas.put(gh1, fillCopy(inputRelation1.getCol(i), f1));
            gh1 = gh1.nextInRow();
        }

        Cell e2 = e1.nextInColumn();
        Cell f2 = f1.nextInColumn();
        Cell a2 = a1.nextInColumn();
        formulas.put(e2,fillIf2(a2, sbWklejka2.toString(), sbWklejka1row2.toString(), e1));
        formulas.put(f2,fillMatch(e2.getColumnO()));
       
        Cell gh2 = f2.nextInRow();
        for (int i = 1; i <= inputRelation1.getCardinality(); i++) {
            formulas.put(gh2, fillCopy(inputRelation1.getCol(i), f2));
            gh2 = gh2.nextInRow();
        }
    }
View Full Code Here

        dummyRelation = caf.getSpaceForNewRelation(2);
        labelDummy(dummyRelation, "Duplicate Removal of "+inputRelation.toString(caf));
        resultRelation = caf.getSpaceForNewRelation(inputRelation.getCardinality());
        labelResult(resultRelation, "Duplicate Removal of "+inputRelation.toString(caf));

        Cell a1 = caf.getLeftTopCellInRelation(inputRelation);
        Cell c1 = caf.getLeftTopCellInRelation(dummyRelation);
        Cell d1 = c1.nextInRow();
        Column c = dummyRelation.getFirstCol();
        String strC = c.toString(caf);
        String strMATCH = String.format(MATCH, strC, strC);
        String strD1 = d1.toString(caf);
        formulas.put(c1, String.format(FR_IF, a1.toString(caf)));
        formulas.put(d1, strMATCH);

        Cell ef1 = d1.nextInRow();
        for (Column ab : inputRelation) {
            String strAb = ab.toString(caf);
            formulas.put(ef1, String.format(INDEX, strAb, strAb, strD1));
            ef1 = ef1.nextInRow();
        }

        Cell a2 = a1.nextInColumn();
        Cell c2 = c1.nextInColumn();
        Cell d2 = d1.nextInColumn();
        String strC1 = c1.toString(caf);
        StringBuilder sb = new StringBuilder(String.format(SR_TO_REPEAT, a1.getColumnO().toString(caf), a1.getRowO().toString(caf), a2.toString(caf), a2.toString(caf)));
        boolean skipFirst = true;
        for (Column ab : inputRelation) {
            if (skipFirst) {
                skipFirst = false;
                continue;
            }
            Cell cell1 = new Cell(ab, new Row(1));
            Cell cell2 = cell1.nextInColumn();
            sb.append(",");
            sb.append(String.format(SR_TO_REPEAT, cell1.getColumnO().toString(caf), cell1.getRowO().toString(caf), cell2.toString(caf), cell2.toString(caf)));
        }

        formulas.put(c2, String.format(SR_IF, a2.toString(caf), sb.toString(), strC1, strC1));
        formulas.put(d2, strMATCH);

        Cell ef2 = d1.nextInRow().nextInColumn();
        String strD2 = d1.nextInColumn().toString(caf);
        for (Column ab : inputRelation) {
            String strAb = ab.toString(caf);
            formulas.put(ef2, String.format(INDEX, strAb, strAb, strD2));
            ef2 = ef2.nextInRow();
        }

    }
View Full Code Here

        dummyRelation = caf.getEmptyRelation();
        resultRelation = caf.getSpaceForNewRelation(inputRelation1.getCardinality());
        labelResult(resultRelation, "Semi Join of "+ inputRelation1.toString(caf) + " and " + inputRelation2.toString(caf));

        for (int row = 1; row <= 2; row++) {
            Cell keyResult = resultRelation.getFirstCol().getCell(row);
            Cell keyFirstRel = inputRelation1.getCol(index1).getCell(row);
            Column keyColSecondRel = inputRelation2.getCol(index2);
            formulas.put(keyResult, fillIf(keyFirstRel, keyColSecondRel));

            Cell res = keyResult.nextInRow();
            int i = 1;
            for (Column c : inputRelation1) {
                if (i++ == index1) {
                    continue;
                }
                formulas.put(res, fillCopy(keyResult, c.getCell(row)));
                res = res.nextInRow();
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.jacobpatterson.csci446.program1.core.Cell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.