
edu.stanford.protege.webprotege.frame.PropertyValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webprotege-entity-frames Show documentation
Show all versions of webprotege-entity-frames Show documentation
Data structures for dealing with entity frames
The newest version!
package edu.stanford.protege.webprotege.frame;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import edu.stanford.protege.webprotege.entity.OWLPrimitiveData;
import edu.stanford.protege.webprotege.entity.OWLPropertyData;
import javax.annotation.Nonnull;
import java.io.Serializable;
/**
* Author: Matthew Horridge
* Stanford University
* Bio-Medical Informatics Research Group
* Date: 21/11/2012
*/
@JsonSubTypes({
@Type(PropertyClassValue.class),
@Type(PropertyIndividualValue.class),
@Type(PropertyDatatypeValue.class),
@Type(PropertyLiteralValue.class),
@Type(PropertyAnnotationValue.class)
})
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
public abstract class PropertyValue implements Comparable, Serializable {
public abstract OWLPropertyData getProperty();
public abstract OWLPrimitiveData getValue();
public abstract State getState();
@JsonIgnore
public abstract boolean isValueMostSpecific();
@JsonIgnore
public abstract boolean isAnnotation();
@JsonIgnore
public abstract boolean isLogical();
public abstract R accept(PropertyValueVisitor visitor) throws E;
public PropertyValue setState(State state) {
if(getState() == state) {
return this;
}
else {
return duplicateWithState(state);
}
}
protected abstract PropertyValue duplicateWithState(State state);
@Override
public int compareTo(PropertyValue o) {
int propertyDiff = getProperty().compareTo(o.getProperty());
if(propertyDiff != 0) {
return propertyDiff;
}
int valueDiff = getValue().compareTo(o.getValue());
return valueDiff;
}
@Nonnull
public abstract PlainPropertyValue toPlainPropertyValue();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy