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

jason.stdlib.set.add_all Maven / Gradle / Ivy

The newest version!
package jason.stdlib.set;

import java.util.Collection;

import jason.asSemantics.InternalAction;
import jason.asSemantics.TransitionSystem;
import jason.asSemantics.Unifier;
import jason.asSyntax.SetTerm;
import jason.asSyntax.Term;


public class add_all extends add {

    private static InternalAction singleton = null;
    public static InternalAction create() {
        if (singleton == null)
            singleton = new add_all();
        return singleton;
    }

    @Override
    public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception {
        SetTerm s = getSet(un, args);
        for (Term t: (Collection)args[1]) {
            s.add(t);
        }
        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy