Algernon Software

org.algernon.kb.okbc.protege
Class AlgernonProtegeValueType

java.lang.Object
  extended byorg.jatha.dynatype.StandardLispValue
      extended byorg.algernon.kb.okbc.protege.AlgernonProtegeObject
          extended byorg.algernon.kb.okbc.protege.AlgernonProtegeValueType
All Implemented Interfaces:
AlgernonObject, AlgernonValueType, Comparable, LispValue

public class AlgernonProtegeValueType
extends AlgernonProtegeObject
implements AlgernonValueType

Class AlgernonProtegeGenValueType ----------------- This class provides a mapping from Algernon value types to Protege and back.


Field Summary
 AlgernonProtegeValueType ANY
           
 AlgernonProtegeValueType BOOLEAN
           
private  int f_intValue
           
private  Class f_javaType
           
private static int f_nValues
           
private  String f_string
           
private static Map f_values
           
private  ValueType f_ValueType
           
 AlgernonProtegeValueType FLOAT
           
 AlgernonProtegeValueType FOREIGN
           
 AlgernonProtegeValueType FRAME
           
 AlgernonProtegeValueType INTEGER
           
 AlgernonProtegeValueType STRING
           
 AlgernonProtegeValueType SYMBOL
           
 AlgernonProtegeValueType VALUETYPE
           
 
Fields inherited from class org.algernon.kb.okbc.protege.AlgernonProtegeObject
f_algy
 
Fields inherited from class org.jatha.dynatype.StandardLispValue
f_lisp
 
Fields inherited from interface org.algernon.kb.AlgernonValueType
VALUETYP
 
Constructor Summary
  AlgernonProtegeValueType(Algernon algy)
           
private AlgernonProtegeValueType(Algernon algy, String s, Class javaType)
           
private AlgernonProtegeValueType(Algernon algy, String s, ValueType vt)
           
 
Method Summary
 boolean canAssignToValueType(Object o, AlgernonValueType vt)
          Returns true if the Object o can be assigned to a slot having a ValueType vt.
 AlgernonValueType convertToAlgernonValueType(Object incomingVT)
          Convert a given value type (such as Protege's ValueType) to an AlgernonValueType.
 boolean equals(AlgernonProtegeValueType otherValueType)
          Returns true if the implementation is equal to the implementation of the argument.
 AlgernonValueType getAlgernonValueType(Object o)
          returns the AlgernonValueType associated with the java object
 Object getImplementation()
          returns the low level type associated with this class.
 int getIntValue()
          returns the int value associated with this valuetype
 Class getJavaType()
          returns the java class associated with this valuetype
 Collection getValues()
           
 AlgernonValueType getValueType(Object o)
          Get the data type of the Java object passed in; we expect this to be Integer, Float, Boolean, Cls, or Instance
static Collection getValueTypes()
           
 int hashCode()
          Forwards the hashcode method to the Protege object so that hash tables of Protege objects will not store duplicate frames.
private  void initializeValues()
           
 boolean isSimpleType()
          Predicate that returns true if this AlgernonValueType is a BOOLEAN, INTEGER, FLOAT, STRING, or SYMBOL
static void main(String[] args)
           
 String toString()
          returns the string label, such as "CLS" associated with this valuetype
static AlgernonValueType valueOf(String s)
           
 
Methods inherited from class org.algernon.kb.okbc.protege.AlgernonProtegeObject
getAlgernon, getName
 
Methods inherited from class org.jatha.dynatype.StandardLispValue
abs, acos, add, adjustSpecialCount, append, apply, apropos_print, asin, assoc, atan, atan2, atom, basic_atom, basic_bignump, basic_consp, basic_constantp, basic_floatp, basic_foreignp, basic_functionp, basic_integerp, basic_keywordp, basic_length, basic_listp, basic_macrop, basic_null, basic_numberp, basic_stringp, basic_symbolp, bignump, boundp, butlast, car, cdr, ceiling, characterp, clrhash, compareTo, concatenate, consp, constantp, contains, copy_list, copy, cos, cot, csc, degreesToRadians, divide, eighth, elt, elt, eq, eql, equal, equalNumeric, factorial, fboundp, fifth, first, floatp, floor, fourth, funcall, functionp, get_specialCount, gethash, gethash, getLisp, greaterThan, greaterThanOrEqual, hash_table_count, hash_table_rehash_size, hash_table_rehash_threshold, hash_table_size, hash_table_test, hashtablep, integerp, internal_getName, internal_prin1_as_cdr, internal_prin1, internal_princ_as_cdr, internal_princ, internal_print_as_cdr, internal_print, iterator, keywordp, last, length, lessThan, lessThanOrEqual, lisp_null, list, listp, max, member, min, multiply, nconc, negate, neql, ninth, nreverse, nstringCapitalize, nstringDowncase, nstringUpcase, numberp, pop, position, prin1, princ, print, push, radiansToDegrees, rassoc, reciprocal, remhash, remove, rest, reverse, rplaca, rplacd, sec, second, set_special, setf_gethash, setf_symbol_function, setf_symbol_plist, setf_symbol_value, setLisp, setPackage, setq, seventh, sin, sixth, specialP, sqrt, string, stringCapitalize, stringDowncase, stringEndsWith, stringEq, stringEqual, stringGreaterP, stringGreaterThan, stringGreaterThanOrEqual, stringLeftTrim, stringLeftTrim, stringLessP, stringLessThan, stringLessThanOrEqual, stringNeq, stringNotGreaterP, stringNotLessP, stringp, stringRightTrim, stringRightTrim, stringStartsWith, stringTrim, stringTrim, stringUpcase, subst, substring, substring, subtract, symbol_function, symbol_name, symbol_package, symbol_plist, symbol_value, symbolp, tan, tenth, third, toCollection, toJava, toJava, toString, toStringAsCdr_internal, toStringAsCdr, toStringShort, toStringShort, toStringSimple, type_of, typep, zerop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

f_nValues

private static int f_nValues

f_values

private static Map f_values

f_string

private String f_string

f_intValue

private int f_intValue

f_javaType

private Class f_javaType

f_ValueType

private ValueType f_ValueType

ANY

public AlgernonProtegeValueType ANY

BOOLEAN

public AlgernonProtegeValueType BOOLEAN

FLOAT

public AlgernonProtegeValueType FLOAT

FRAME

public AlgernonProtegeValueType FRAME

INTEGER

public AlgernonProtegeValueType INTEGER

STRING

public AlgernonProtegeValueType STRING

SYMBOL

public AlgernonProtegeValueType SYMBOL

VALUETYPE

public AlgernonProtegeValueType VALUETYPE

FOREIGN

public AlgernonProtegeValueType FOREIGN
Constructor Detail

AlgernonProtegeValueType

private AlgernonProtegeValueType(Algernon algy,
                                 String s,
                                 ValueType vt)

AlgernonProtegeValueType

private AlgernonProtegeValueType(Algernon algy,
                                 String s,
                                 Class javaType)

AlgernonProtegeValueType

public AlgernonProtegeValueType(Algernon algy)
Method Detail

initializeValues

private void initializeValues()

hashCode

public int hashCode()
Forwards the hashcode method to the Protege object so that hash tables of Protege objects will not store duplicate frames.

Returns:
the hash code

getImplementation

public Object getImplementation()
Description copied from interface: AlgernonValueType
returns the low level type associated with this class.

Specified by:
getImplementation in interface AlgernonValueType

getIntValue

public int getIntValue()
Description copied from interface: AlgernonValueType
returns the int value associated with this valuetype

Specified by:
getIntValue in interface AlgernonValueType

getJavaType

public Class getJavaType()
Description copied from interface: AlgernonValueType
returns the java class associated with this valuetype

Specified by:
getJavaType in interface AlgernonValueType

convertToAlgernonValueType

public AlgernonValueType convertToAlgernonValueType(Object incomingVT)
Convert a given value type (such as Protege's ValueType) to an AlgernonValueType. Returns null if there is no such mapping.

Specified by:
convertToAlgernonValueType in interface AlgernonValueType

getAlgernonValueType

public AlgernonValueType getAlgernonValueType(Object o)
Description copied from interface: AlgernonValueType
returns the AlgernonValueType associated with the java object

Specified by:
getAlgernonValueType in interface AlgernonValueType

getValueTypes

public static Collection getValueTypes()

isSimpleType

public boolean isSimpleType()
Predicate that returns true if this AlgernonValueType is a BOOLEAN, INTEGER, FLOAT, STRING, or SYMBOL

Specified by:
isSimpleType in interface AlgernonValueType

toString

public String toString()
Description copied from interface: AlgernonValueType
returns the string label, such as "CLS" associated with this valuetype

Specified by:
toString in interface AlgernonValueType
Overrides:
toString in class AlgernonProtegeObject

equals

public boolean equals(AlgernonProtegeValueType otherValueType)
Returns true if the implementation is equal to the implementation of the argument.


valueOf

public static AlgernonValueType valueOf(String s)
                                 throws AlgernonDataException
Throws:
AlgernonDataException

getValueType

public AlgernonValueType getValueType(Object o)
Get the data type of the Java object passed in; we expect this to be Integer, Float, Boolean, Cls, or Instance


getValues

public Collection getValues()
Specified by:
getValues in interface AlgernonValueType

canAssignToValueType

public boolean canAssignToValueType(Object o,
                                    AlgernonValueType vt)
Returns true if the Object o can be assigned to a slot having a ValueType vt.


main

public static void main(String[] args)

Algernon Software