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

edu.cmu.tetradapp.ui.model.IndependenceTestModel Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2017 University of Pittsburgh.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301  USA
 */
package edu.cmu.tetradapp.ui.model;

import edu.cmu.tetrad.annotation.AnnotatedClass;
import edu.cmu.tetrad.annotation.TestOfIndependence;
import edu.cmu.tetrad.util.IndependenceTestDescriptions;

import java.io.Serial;
import java.io.Serializable;

/**
 * Dec 1, 2017 11:46:06 AM
 *
 * @author Kevin V. Bui ([email protected])
 * @version $Id: $Id
 */
public class IndependenceTestModel implements Serializable, Comparable {

    @Serial
    private static final long serialVersionUID = -6802442235695595011L;

    /**
     * The annotated class of the independence test.
     */
    private final AnnotatedClass independenceTest;

    /**
     * The name and description of the independence test.
     */
    private final String name;

    /**
     * The description of the independence test.
     */
    private final String description;

    /**
     * 

Constructor for IndependenceTestModel.

* * @param independenceTest a {@link edu.cmu.tetrad.annotation.AnnotatedClass} object */ public IndependenceTestModel(AnnotatedClass independenceTest) { this.independenceTest = independenceTest; this.name = independenceTest.annotation().name(); this.description = IndependenceTestDescriptions.getInstance().get(independenceTest.annotation().command()); } /** * Compares this IndependenceTestModel object with the specified IndependenceTestModel object based on the name of * the tests. * * @param other the IndependenceTestModel object to be compared * @return a negative integer, zero, or a positive integer as this IndependenceTestModel is less than, equal to, or * greater than the specified IndependenceTestModel */ @Override public int compareTo(IndependenceTestModel other) { return this.independenceTest.annotation().name().compareTo(other.independenceTest.annotation().name()); } /** * Returns a string representation of the object. * * @return the name of the object */ @Override public String toString() { return this.name; } /** *

Getter for the field independenceTest.

* * @return a {@link edu.cmu.tetrad.annotation.AnnotatedClass} object */ public AnnotatedClass getIndependenceTest() { return this.independenceTest; } /** *

Getter for the field name.

* * @return a {@link java.lang.String} object */ public String getName() { return this.name; } /** *

Getter for the field description.

* * @return a {@link java.lang.String} object */ public String getDescription() { return this.description; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy