Class Slot

java.lang.Object
  |
  +--Slot
All Implemented Interfaces:
java.io.Serializable

public class Slot
extends java.lang.Object
implements java.io.Serializable

The class `Slot' represents a slot in a frame. It has a name and a type. Each frame class has a set of slots associated with it, which instances of the frame class can have fillers for.

See Also:
Serialized Form

Constructor Summary
Slot(jex.Attribute slotAttr, FrameClass frameClass, jex.Schema frameClassSchema)
          Constructs this slot by plugging in the given Jex Attribute object which is taken to represent it (it does so by copying the reference, which is maximally efficient, but the client should not then alter the Attribute directly, as that would compromise the integrity of the frame).
 
Method Summary
 boolean convertEmptyToNull()
          Returns true just in case empty aggregations should be converted to null to fill this slot.
 FrameClass getFrameClassDeclaredIn()
          Returns the frame class in which this slot was declared (the supertype from which it is inherited).
 boolean getIgnore()
          Returns true just in case the CCUS frame matching algorithm should ignore this slot.
 java.lang.String getName()
          Returns the name of this slot.
 Frame getSlotFrame()
          Delivers up the underlying frame of this slot.
 java.lang.Object getType()
          Returns the type of this slot.
static void ignoration()
          Slots marked with --IGNORE in the frame class model are to be ignored.
 boolean isAggType()
          Returns true just in case this slot is of an aggregation type (i.e.
 boolean isOptional()
          Returns true just in case this slot is optional (i.e.
 boolean isOrderedAggType()
          Returns true just in case this slot is of an ordered aggregation type (i.e.
 boolean isUnorderedAggType()
          Returns true just in case this slot is of an unordered aggregation type (i.e.
static Slot lookupInverseSlot(java.lang.String frameClass, java.lang.String slot, FrameClass slotFillerFrameClass)
          Looks up the inverse slot of a given slot in a given frame class whose filler is frame of a given frame class.
static void readClass(java.io.ObjectInput oi)
          Deserialises the static data members (class variables) of Slot.
 void setIgnore(boolean ignore)
          Marks this slot to be ignored (or not) by the CCUS frame matching algorithm.
 java.lang.String toString()
          Returns a string representation of this slot.
static void writeClass(java.io.ObjectOutput oo)
          Serialises the static data members (class variables) of Slot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Slot

public Slot(jex.Attribute slotAttr,
            FrameClass frameClass,
            jex.Schema frameClassSchema)
Constructs this slot by plugging in the given Jex Attribute object which is taken to represent it (it does so by copying the reference, which is maximally efficient, but the client should not then alter the Attribute directly, as that would compromise the integrity of the frame).
Parameters:
slotAttr - A Jex Attribute object to wrap in this frame.
frameClass - The frame class to which this slot belongs.
frameClassSchema - The frame class schema in which this slot is defined.
Method Detail

ignoration

public static void ignoration()
Slots marked with --IGNORE in the frame class model are to be ignored. This method is called from Frame.initialise.

getSlotFrame

public Frame getSlotFrame()
Delivers up the underlying frame of this slot.
Returns:
The frame representing this slot.

getName

public java.lang.String getName()
Returns the name of this slot.
Returns:
The name of this slot.

toString

public java.lang.String toString()
Returns a string representation of this slot.
Overrides:
toString in class java.lang.Object
Returns:
The string representation of this slot.

getFrameClassDeclaredIn

public FrameClass getFrameClassDeclaredIn()
Returns the frame class in which this slot was declared (the supertype from which it is inherited).
Returns:
The name of this slot.

getType

public java.lang.Object getType()
Returns the type of this slot.
Returns:
The type of this slot.

isAggType

public boolean isAggType()
Returns true just in case this slot is of an aggregation type (i.e. to be filled by a set, bag, list or array).
Returns:
Whether this slot is of an aggregation type.

isUnorderedAggType

public boolean isUnorderedAggType()
Returns true just in case this slot is of an unordered aggregation type (i.e. to be filled by a set or bag).
Returns:
Whether this slot is of an unordered aggregation type.

isOrderedAggType

public boolean isOrderedAggType()
Returns true just in case this slot is of an ordered aggregation type (i.e. to be filled by a list or array).
Returns:
Whether this slot is of an ordered aggregation type.

isOptional

public boolean isOptional()
Returns true just in case this slot is optional (i.e. can have a null filler).
Returns:
Whether this slot is optional.

convertEmptyToNull

public boolean convertEmptyToNull()
Returns true just in case empty aggregations should be converted to null to fill this slot.
Returns:
Whether empty aggregations should be converted to null.

getIgnore

public boolean getIgnore()
Returns true just in case the CCUS frame matching algorithm should ignore this slot.
Returns:
True if the CCUS frame matching algorithm should ignore this slot, false otherwise.

setIgnore

public void setIgnore(boolean ignore)
Marks this slot to be ignored (or not) by the CCUS frame matching algorithm.
Parameters:
ignore - True if the CCUS frame matching algorithm should ignore this slot, false otherwise.

lookupInverseSlot

public static Slot lookupInverseSlot(java.lang.String frameClass,
                                     java.lang.String slot,
                                     FrameClass slotFillerFrameClass)
Looks up the inverse slot of a given slot in a given frame class whose filler is frame of a given frame class.
Parameters:
frameClass - The name of the frame class the slot whose inverse is to be looked up is in.
slot - The name of the slot whose inverse is to be looked up.
slotFillerFrameClass - The frame class of the actual filler (must be a frame) of `slot'.
Returns:
The inverse slot of frameClass.slot for a filler of type slotFillerFrameClass, or null if there isn't one.

writeClass

public static void writeClass(java.io.ObjectOutput oo)
                       throws java.io.IOException
Serialises the static data members (class variables) of Slot.
Parameters:
oo - An output stream to save the class data to.
Throws:
java.io.IOException - If an I/O exception occurs.

readClass

public static void readClass(java.io.ObjectInput oi)
                      throws java.io.IOException
Deserialises the static data members (class variables) of Slot.
Parameters:
oi - An input stream to save the class data to.
Throws:
java.io.IOException - If an I/O exception occurs.