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

org.ggp.base.util.gdl.grammar.GdlDistinct Maven / Gradle / Ivy

The newest version!
package org.ggp.base.util.gdl.grammar;

public final class GdlDistinct extends GdlLiteral
{
    private static final long serialVersionUID = 1L;

    private final GdlTerm arg1;
    private final GdlTerm arg2;
    private transient Boolean ground;

    GdlDistinct(GdlTerm arg1, GdlTerm arg2)
    {
        this.arg1 = arg1;
        this.arg2 = arg2;
        ground = null;
    }

    public GdlTerm getArg1()
    {
        return arg1;
    }

    public GdlTerm getArg2()
    {
        return arg2;
    }

    @Override
    public boolean isGround()
    {
        if (ground == null)
        {
            ground = arg1.isGround() && arg2.isGround();
        }

        return ground;
    }

    @Override
    public String toString()
    {
        return "( distinct " + arg1 + " " + arg2 + " )";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy