sl
Class SlotDescriptor

java.lang.Object
  extended bysl.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.

Version:
$Date: 2003/10/09 13:00:37 $ $Revision: 1.1.1.1 $
Author:
Giovanni Rimassa - Universita` di Parma

Field Summary
private  int category
           
private  CaseInsensitiveString name
           
private  boolean optionality
           
(package private) static java.util.List primitiveTypes
          static List of primitive types
private  java.lang.String type
           
 
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.
(package private)  void setName(java.lang.String n)
           
 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
 

Field Detail

name

private CaseInsensitiveString name

category

private int category

type

private java.lang.String type

optionality

private boolean optionality

primitiveTypes

static final java.util.List primitiveTypes
static List of primitive types

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#SlotDescriptor(String n, int t, String vt, boolean o)
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.

setName

void setName(java.lang.String n)

toString

public java.lang.String toString()
return a String representation of the object, just for debugging purposes



Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.