Package ra

Source Code of ra.Result

package ra;

import core.ColumnLabels;
import core.Formulas;
import core.Relation;
import operators.Operator;

/**
*
* @author Jacek Sroka
*/
public class Result {

    private Formulas formulas;
    private Relation dummyRelation;
    private Relation resultRelation;
    private ColumnLabels labels;

    public Result() {
        formulas = new Formulas();
        labels = new ColumnLabels();
        dummyRelation = Utils.getCaf().getEmptyRelation();
        resultRelation = Utils.getCaf().getEmptyRelation();
    }

    public Result(Formulas f, Relation dummyR, Relation resultR, ColumnLabels l) {
        this();
        extend(f, dummyR, resultR, l);
    }

    public Result(Operator oper) {
        this();
        extend(oper);
    }

    public Result(Result other) {
        this();
        extend(other);
    }

    public Formulas getFormulas() {
        return formulas;
    }

    public Relation getDummyRelation() {
        return dummyRelation;
    }

    public Relation getResultRelation() {
        return resultRelation;
    }

    public ColumnLabels getLabels() {
        return labels;
    }

    //extends this and returns it
    final public Result extend(Formulas f, Relation dummyR, Relation resultR, ColumnLabels l) {
        formulas.putAll(f);
        formulas.sortColumns();
        dummyRelation = dummyR;
        resultRelation = resultR;
        labels.putAll(l);
        return this;
    }

    final public Result extend(Operator oper) {
        return extend(oper.getFormulas(), oper.getDummyRelation(), oper.getResultRelation(), oper.getLabels());
    }

    final public Result extend(Result other) {
        return extend(other.getFormulas(), other.getDummyRelation(), other.getResultRelation(), other.getLabels());
    }
   
    public Result clone() {
        return new Result(this);
    }
}
TOP

Related Classes of ra.Result

TOP
Copyright © 2018 www.massapi.com. 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.