jade.onto
Class SlotDescriptor

java.lang.Object
  |
  +--jade.onto.SlotDescriptor

public class SlotDescriptor
extends java.lang.Object

Descriptor class for the slots of ontological roles. Instances of this class are used to describe the characteristics of the slots of a role in an ontology.

Author:
Giovanni Rimassa - Universita` di Parma

Constructor Summary
SlotDescriptor(int c, java.lang.String t, boolean o)
          Build the descriptor for an unnamed slot.
SlotDescriptor(java.lang.String n, int c, java.lang.String t, boolean o)
          Build the descriptor for a named slot.
 
Method Summary
 int getCategory()
          Get the category of a slot.
 java.lang.String getName()
          Get the name of a slot.
 java.lang.String getType()
          Get the name of the type of the values of this slot.
 boolean hasPrimitiveType()
           
 boolean isComplex()
          Tells whether a slot is complex.
 boolean isOptional()
          Tells whether a slot is optional.
 boolean isPrimitive()
          Tells whethet the slot is primitive.
 boolean isSet()
          Tells whether a slot is set or a sequence.
 java.lang.String toString()
          return a String representation of the object, just for debugging purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SlotDescriptor

public SlotDescriptor(java.lang.String n,
                      int c,
                      java.lang.String t,
                      boolean o)
Build the descriptor for a named slot.
Parameters:
n - The name of the described slot.
c - A symbolic constant identifying the category of the slot (i.e. one value between Ontology.FRAME_SLOT , Ontology.SET_SLOT, Ontology.SEQUENCE_SLOT, Ontology.PRIMITIVE_SLOT, Ontology.ANY_SLOT. )
t - The name of the type of the values allowed for this slot, (i.e. one value between Ontology.STRING_TYPE, Ontology.XXX_TYPE , or, in case of a FRAME_SLOT, the name of the role in the ontology the value of this slot is an instance of
o - One of Ontology.M (for mandatory slots) and Ontology.O (for optional slots).

SlotDescriptor

public SlotDescriptor(int c,
                      java.lang.String t,
                      boolean o)
Build the descriptor for an unnamed slot.
See Also:
jade.onto
Method Detail

getName

public java.lang.String getName()
Get the name of a slot.
Returns:
The name of the slot described by this object, as set by the constructor, or "" if the slot is unnamed.

getCategory

public int getCategory()
Get the category of a slot.
Returns:
A symbolic constant, representing the category of the slot described by this object, as set by the constructor.

getType

public java.lang.String getType()
Get the name of the type of the values of this slot.
Returns:
The name of the type of the values for this slot described by this object, as set by the constructor. For primitive types, the name of the type is returned (e.g. java.lang.Integer or java.lang.String); for complex types, the name of the specific concept is returned.

hasPrimitiveType

public boolean hasPrimitiveType()
Returns:
true if the values of this slot assumes primitive types (e.g. Integer, String, ...)

isOptional

public boolean isOptional()
Tells whether a slot is optional.
Returns:
true if the slot described by this object is optional in its ontological role, false otherwise.

isComplex

public boolean isComplex()
Tells whether a slot is complex.
Returns:
true if the category of the slot described by this object is Ontology.FRAME_SLOT false otherwise.

isSet

public boolean isSet()
Tells whether a slot is set or a sequence.
Returns:
true if the category of the slot described by this object is Ontology.SET_SLOT or Ontology.SEQUENCE_SLOT) false otherwise.

isPrimitive

public boolean isPrimitive()
Tells whethet the slot is primitive.
Returns:
true if the category of the slot described by this object is Ontology.PRIMITIVE_SLOT false otherwise.

toString

public java.lang.String toString()
return a String representation of the object, just for debugging purposes
Overrides:
toString in class java.lang.Object