com.articulate.sigma.AVPair Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sigma-component Show documentation
Show all versions of sigma-component Show documentation
Sigma knowledge engineering system is an system for developing, viewing and debugging theories in first
order logic. It works with Knowledge Interchange Format (KIF) and is optimized for the Suggested Upper Merged
Ontology (SUMO) www.ontologyportal.org.
/* This code is copyrighted by Articulate Software (c) 2003.
It is released underthe GNU Public License .
Users ofthis code also consent, by use of this code, to credit Articulate Software in any
writings, briefings,publications, presentations, or other representations of any
software which incorporates, builds on, or uses this code.*/
package com.articulate.sigma;
public class AVPair implements Comparable {
public String attribute =""; // this is the sort field for comparison
public String value = "";
public int compareTo(Object avp) throws ClassCastException {
if (!avp.getClass().getName().equalsIgnoreCase("com.articulate.sigma.AVPair"))
throw new ClassCastException("Error in AVPair.compareTo(): "
+ "Class cast exception for argument of class: "
+ avp.getClass().getName());
//System.out.println("Info in AVPair.compareTo(): comparing: " + attribute +
// "to: " + ((AVPair) avp).attribute);
return attribute.compareTo(((AVPair) avp).attribute);
}
public String toString() {
return "[" + attribute + "," + value + "]";
}
}