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

com.espertech.esper.pattern.EvalNodeAnalysisResult Maven / Gradle / Ivy

Go to download

Complex event processing and event series analysis component

There is a newer version: 7.1.0
Show newest version
/**************************************************************************************
 * Copyright (C) 2008 EsperTech, Inc. All rights reserved.                            *
 * http://esper.codehaus.org                                                          *
 * 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.pattern;

import java.util.List;
import java.util.ArrayList;

/**
 * Result of analysis of pattern expression node tree.
 */
public class EvalNodeAnalysisResult
{
    private List activeNodes = new ArrayList();

    /**
     * Add a node found.
     * @param node found
     */
    public void addNode(EvalNode node)
    {
        activeNodes.add(node);
    }

    /**
     * Returns all nodes found.
     * @return pattern nodes
     */
    public List getActiveNodes()
    {
        return activeNodes;
    }

    /**
     * Returns filter nodes.
     * @return filter nodes
     */
    public List getFilterNodes()
    {
        List filterNodes = new ArrayList();
        for (EvalNode node : activeNodes)
        {
            if (node instanceof EvalFilterNode)
            {
                filterNodes.add((EvalFilterNode) node);
            }
        }
        return filterNodes;
    }

    /**
     * Returns the repeat-nodes.
     * @return repeat nodes
     */
    public List getRepeatNodes()
    {
        List filterNodes = new ArrayList();
        for (EvalNode node : activeNodes)
        {
            if (node instanceof EvalMatchUntilNode)
            {
                filterNodes.add((EvalMatchUntilNode) node);
            }
        }
        return filterNodes;
    }

    /**
     * Returns the every-distinct-nodes.
     * @return distinct nodes
     */
    public List getDistinctNodes()
    {
        List filterNodes = new ArrayList();
        for (EvalNode node : activeNodes)
        {
            if (node instanceof EvalEveryDistinctNode)
            {
                filterNodes.add((EvalEveryDistinctNode) node);
            }
        }
        return filterNodes;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy