Class Case

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

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

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

See Also:
Serialized Form

Constructor Summary
Case(Frame caseFrame)
          Constructs a case from a given frame.
 
Method Summary
 java.util.Vector extract()
          Extract this case's solution frames into new instantiations for the problem situation (i.e.
 Frame extractFrame(Frame caseSolutionFrame)
          Create a new frame, copying from the given frame from the case.
 Frame getCaseFrame()
          Delivers up the underlying frame of this case.
 FrameClass getProblemFrameClass()
          Delivers up the frame class of the frame which fills this case's `problem' slot.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.
Method Detail

getCaseFrame

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

getProblemFrameClass

public FrameClass getProblemFrameClass()
Delivers up the frame class of the frame which fills this case's `problem' slot.
Returns:
The frame class of this case's top-level `problem' frame.

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:
Whether `frame' matches the case well enough.

extract

public java.util.Vector extract()
Extract this case's solution frames into new instantiations for the problem situation (i.e. the input model). 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 is an adaptation case, use extractFrame to adapt an existing solution frame.
Returns:
The (usually singleton) vector of solution frames thus created.

extractFrame

public Frame extractFrame(Frame caseSolutionFrame)
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:
caseSolutionFrame - The solution frame from the case.
Returns:
A solution frame for the problem situation.