Class Case

java.lang.Object
   |
   +----Case

public class Case
extends Object
implements Serializable
The class `Case' represents a case, which encapsulates a "case" frame. Case is the unit of matching and adaptation.


Constructor Index

 o Case(Frame)
Constructs a case from a given frame.

Method Index

 o extract()
Extract the slots from this case's solution frame into a new instantiation of the solution frame for the problem situation.
 o extractFrame(Frame)
Create a new frame, copying from the given frame from the case.
 o getCaseFrame()
Delivers up the underlying frame of this case.
 o match(Frame)
Matches this case with the given frame, returning true if the match is good enough to extract the HLC suggested by the case.

Constructors

 o Case
 public Case(Frame caseFrame)
Constructs a case from a given frame. Marks all frames in the transitive closure of the problem slot as being such.

Parameters:
caseFrame - A frame to construct the case from, which should be of the "case" frame class. All frames in the transitive closure of this one's slots are treated as part of the case.

Methods

 o getCaseFrame
 public Frame getCaseFrame()
Delivers up the underlying frame of this case.

Returns:
The case representing this case.
 o match
 public boolean match(Frame frame)
Matches this case with the given frame, returning true if the match is good enough to extract the HLC suggested by the case.

Parameters:
frame - A frame to match the "problem" part of this case to. All slots in the case's "problem" frame will be matched; any frames will be matched recursively.
Returns:
s Whether `frame' matches the case well enough.
 o extract
 public Frame extract()
Extract the slots from this case's solution frame into a new instantiation of the solution frame for the problem situation. The client must have called match first, to check that it is appropriate to extract the solution and to obtain the bindings for variables and frames in the case. This method can be used when the case is for proposing a ballpark solution, because it automatically creates a new solution frame. If it's is an adaptation case, use extractFrame to adapt an existing solution frame.

Returns:
s The solution frame thus created.
 o extractFrame
 public Frame extractFrame(Frame oldSolutionFrame)
Create a new frame, copying from the given frame from the case. The client must have called match first, to check that it is appropriate to extract the solution and to obtain the bindings for variables and frames in the case. This method can be used whether the case is for proposing a ballpark solution or for adaptation.

Parameters:
oldSolutionFrame - A blank frame to copy the slots from the case solution into.
Returns:
s `frame', filled in.