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

org.yamcs.xtce.ComparisonList Maven / Gradle / Ivy

There is a newer version: 5.10.7
Show newest version
package org.yamcs.xtce;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * All comparisons must be true.
 * 
 * @author nm
 *
 */
public class ComparisonList implements MatchCriteria {

    private static final long serialVersionUID = 200805131551L;
    ArrayList comparisons = new ArrayList<>();

    public void addComparison(Comparison comparison) {
        comparisons.add(comparison);
    }

    @Override
    public Set getDependentParameters() {
        Set pset = new HashSet<>();
        for (Comparison c : comparisons) {
            pset.addAll(c.getDependentParameters());
        }
        return pset;
    }

    public List getComparisonList() {
        return comparisons;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("ComparisonList: ");
        for (Comparison c : comparisons) {
            sb.append(c.toString()).append(" ");
        }
        return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy