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

org.swrlapi.drools.sqwrl.DroolsSQWRLCollectionHandler Maven / Gradle / Ivy

There is a newer version: 2.1.2
Show newest version
package org.swrlapi.drools.sqwrl;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.swrlapi.drools.swrl.BA;

import java.util.HashSet;
import java.util.Set;

/**
 * Keeps track of SQWRL collections during rule execution.
 * 

* The {@link #infer(org.swrlapi.drools.swrl.BA)} method in this class is called to inform Drools of inferred SQWRL * collections. * * @see org.swrlapi.drools.sqwrl.SQWRLC */ public class DroolsSQWRLCollectionHandler { @NonNull private final Set<@NonNull SQWRLC> generatedSQWRLCollections; public DroolsSQWRLCollectionHandler() { this.generatedSQWRLCollections = new HashSet<>(); } public void reset() { this.generatedSQWRLCollections.clear(); } public void infer(@NonNull BA ba) { if (ba instanceof SQWRLC) this.generatedSQWRLCollections.add((SQWRLC)ba); } public boolean hasSQWRLCollections() { return !this.generatedSQWRLCollections.isEmpty(); } @NonNull public Set<@NonNull SQWRLC> getSQWRLCollections() { return this.generatedSQWRLCollections; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy