All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.espertech.esper.epl.join.base.HistoricalViewableDesc Maven / Gradle / Ivy

There is a newer version: 7.1.0
Show newest version
/*
 ***************************************************************************************
 *  Copyright (C) 2006 EsperTech, Inc. All rights reserved.                            *
 *  http://www.espertech.com/esper                                                     *
 *  http://www.espertech.com                                                           *
 *  ---------------------------------------------------------------------------------- *
 *  The software in this package is published under the terms of the GPL license       *
 *  a copy of which has been included with this distribution in the license.txt file.  *
 ***************************************************************************************
 */
package com.espertech.esper.epl.join.base;

import java.util.SortedSet;
import java.util.TreeSet;

public class HistoricalViewableDesc {
    private boolean hasHistorical;
    private final SortedSet[] dependenciesPerHistorical;
    private final boolean[] isHistorical;

    public HistoricalViewableDesc(int numStreams) {
        this.dependenciesPerHistorical = new SortedSet[numStreams];
        this.isHistorical = new boolean[numStreams];
    }

    public void setHistorical(int streamNum, SortedSet dependencies) {
        hasHistorical = true;
        isHistorical[streamNum] = true;
        if (dependenciesPerHistorical[streamNum] != null) {
            throw new RuntimeException("Dependencies for stream " + streamNum + "already initialized");
        }
        dependenciesPerHistorical[streamNum] = new TreeSet();
        if (dependencies != null) {
            dependenciesPerHistorical[streamNum].addAll(dependencies);
        }
    }

    public boolean isHasHistorical() {
        return hasHistorical;
    }

    public SortedSet[] getDependenciesPerHistorical() {
        return dependenciesPerHistorical;
    }

    public boolean[] getHistorical() {
        return isHistorical;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy