edu.stanford.smi.protege.model.AbstractFacetConstraint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protege Show documentation
Show all versions of protege Show documentation
Core code for the Protege ontology editor. Serves as the basis for the Protege-Frames and Protege-OWL editors.
package edu.stanford.smi.protege.model;
import java.io.*;
import java.util.*;
import edu.stanford.smi.protege.util.*;
/**
* Base class for implementions of FacetConstraint. Implementations are provided for the is/are valid methods that just
* get the "invalid text" descriptions of the problems and test it. If there is "invalid text" then the values are
* not valid.
*
* @author Ray Fergerson
*/
public abstract class AbstractFacetConstraint implements FacetConstraint, Serializable {
private static final long serialVersionUID = 3517596380804103055L;
public boolean areValidValues(Frame frame, Slot slot, Collection slotValues, Collection facetValues) {
return getInvalidValuesText(frame, slot, slotValues, facetValues) == null;
}
public boolean isValidValue(Frame frame, Slot slot, Object o, Collection facetValues) {
return getInvalidValueText(frame, slot, o, facetValues) == null;
}
public static boolean equals(Object o1, Object o2) {
return SystemUtilities.equals(o1, o2);
}
public String toString() {
return StringUtilities.getClassName(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy