Class Frame
java.lang.Object
|
+----Frame
- public class Frame
- extends Object
- implements Serializable
The class `Frame' represents a frame (an instance of a
FrameClass).
-
_number
-
-
Frame(FrameClass, Hashtable)
- Constructs this frame.
-
Frame(Hashtable)
- Constructs this frame.
-
generateFIL(boolean)
- Writes all frames in the system to an FIL file, called
<frame-class>.fil.
-
generateFIL(PrintWriter, boolean)
- Writes the frame into an FIL file.
-
getFrameClass()
- Returns the frame class of this frame.
-
getNumber()
- Returns this frame's instance number (unique to the frame class).
-
getSlotFiller(Slot)
- Returns the filler of a given slot.
-
getSlotFiller(String)
- Returns the filler of a given slot.
-
getSlots()
- Returns an enumeration of the filled slots in this frame.
-
initialise()
- Initialises the exjava subclasses of Frame, after loading the
EXPRESS metamodel from EXPRESS/frame_classes.exp.
-
isCaseProblemPart()
- Returns true just in case this frame is in the `problem' part of a
case.
-
isSlotSetDirectly(Slot)
- Returns true just in case a given slot in this frame was written
directly (i.e.
-
markCaseProblemPart()
- Marks this frame as being in the problem part of a case, recursing
for all frames in the slot fillers of this frame.
-
print(PrintStream)
- Prints the frame in human-readable text form.
-
setNumber(int)
- Gives this frame an instance number which is unique to this frame
class.
-
setSlotFiller(Slot, Object)
- Fills a given slot with a given value.
-
setSlotFiller(String, Object)
- Fills a given slot with a given value.
-
setSlotFillerIndirectly(Slot, Object)
- Fills a given slot with a given value indirectly (i.e.
-
toString()
- Returns a string representing this frame.
_number
protected int _number
Frame
protected Frame(Hashtable instanceData)
- Constructs this frame. This method is called from the constructors of
subclasses of Frame. It should be called with "new Hashtable" for
instanceData.
- Parameters:
- instanceData - The initial slot fillers for the frame in a hash
table which associates Slot objects with
their filler values. The use of this parameter with any actual
parameter other than "new Hashtable" is deprecated -
construct the frame with a blank hash table instead, and use
setSlotFiller to fill the slots after constructing the frame.
Frame
public Frame(FrameClass frameClass,
Hashtable instanceData) throws InvalidSlot
- Constructs this frame.
- Parameters:
- frameClass - The frame class of the frame to be constructed,
which specifies the set of slots the frame should have.
- instanceData - The initial slot fillers for the frame in a hash
table which associates Slot objects with
their filler values. The use of this parameter with any actual
parameter other than "new Hashtable" is deprecated -
construct the frame with a blank hash table instead, and use
setSlotFiller to fill the slots after constructing the frame.
- Throws: InvalidSlot
- If `instanceData' includes slots other than
those specified in `frameClass'.
initialise
public static void initialise()
- Initialises the exjava subclasses of Frame, after loading the
EXPRESS metamodel from EXPRESS/frame_classes.exp.
getFrameClass
public FrameClass getFrameClass()
- Returns the frame class of this frame.
- Returns:
- The frame class of this frame.
getNumber
public int getNumber()
- Returns this frame's instance number (unique to the frame class).
- Returns:
- s This frame's instance number.
setNumber
public void setNumber(int number)
- Gives this frame an instance number which is unique to this frame
class.
- Parameters:
- An - instance number for this frame.
getSlotFiller
public Object getSlotFiller(Slot slot)
- Returns the filler of a given slot.
- Parameters:
- slot - The slot whose filler you want to read.
- Returns:
- The filler of `slot', as held in this frame.
getSlotFiller
public Object getSlotFiller(String slotName) throws InvalidSlot
- Returns the filler of a given slot.
- Parameters:
- slot - The name of the slot whose filler you want to read.
- Returns:
- The filler of the slot, as held in this frame.
- Throws: InvalidSlot
- If the frame does not have a slot of that name
(as specified in its frame class).
setSlotFiller
public void setSlotFiller(Slot slot,
Object filler)
- Fills a given slot with a given value. Records this slot as having
been written directly.
- Parameters:
- slot - The slot you want to write into.
- filler - The filler (value) you want to write into `slot',
which must be of the right type for `slot'.
setSlotFillerIndirectly
public void setSlotFillerIndirectly(Slot slot,
Object filler)
- Fills a given slot with a given value indirectly (i.e. writing an
inverse slot in response to writing its `FOR' slot). Doesn't record
a direct write on this slot, and doesn't look for any inverses to
fill (because an inverse attribute cannot be the `FOR' attribute of
another inverse attribute).
- Parameters:
- slot - The slot you want to write into.
- filler - The filler (value) you want to write into `slot',
which must be of the right type for `slot'.
setSlotFiller
public void setSlotFiller(String slotName,
Object filler) throws InvalidSlot
- Fills a given slot with a given value.
- Parameters:
- slot - The name of the slot you want to write into.
- filler - The filler (value) you want to write into the slot,
which must be of the right type for the slot.
- Throws: InvalidSlot
- If the frame does not have that slot
(as specified in its frame class).
isSlotSetDirectly
public boolean isSlotSetDirectly(Slot slot)
- Returns true just in case a given slot in this frame was written
directly (i.e. not just filled in automatically as an inverse slot).
- Parameters:
- slot - A slot in this frame (presumably inverse).
- Returns:
- s Whether `slot' has been written directly in this frame.
getSlots
public Enumeration getSlots()
- Returns an enumeration of the filled slots in this frame.
- Returns:
- s An enumeration of the filled slots in this frame.
markCaseProblemPart
public void markCaseProblemPart()
- Marks this frame as being in the problem part of a case, recursing
for all frames in the slot fillers of this frame.
isCaseProblemPart
public boolean isCaseProblemPart()
- Returns true just in case this frame is in the `problem' part of a
case.
- Returns:
- s Whether this frame is in the `problem' part of a case.
toString
public String toString()
- Returns a string representing this frame. The format is
frame-class#number.
- Returns:
- s The string representation of this frame.
- Overrides:
- toString in class Object
print
public void print(PrintStream ps)
- Prints the frame in human-readable text form. Any references are just
printed as they are.
- Parameters:
- ps - A stream to print the frame to.
generateFIL
public static void generateFIL(boolean HTML)
- Writes all frames in the system to an FIL file, called
<frame-class>.fil.
- Parameters:
- HTML - If true, file will be augmented with HTML tags.
generateFIL
public void generateFIL(PrintWriter pw,
boolean HTML)
- Writes the frame into an FIL file. Any references are given
corresponding hypertext links if the HTML flag is true.
- Parameters:
- pw - A file to generate the HTML into (with automatic line
flushing enabled).
- HTML - If true, file will be augmented with HTML tags.