edu.indiana.iucbrf.problem
Class Problem

java.lang.Object
  extended by edu.indiana.iucbrf.problem.Problem
All Implemented Interfaces:
Featured, SwingRepresentableWithDomain, SwingRepresentable, XMLRepresentable, java.io.Serializable, java.lang.Comparable
Direct Known Subclasses:
DevelopingProblem, ProblemIndices

public class Problem
extends java.lang.Object
implements java.io.Serializable, Featured, java.lang.Comparable, XMLRepresentable

Classes in the Problem component package are used both as a part of a Case object and as stand-alone descriptors of new problems entering the system. A problem is represented as a FeatureCollection of Feature objects. Each Feature type may be as complex as needed, so this is not a restriction of expressive power. All Problem objects of a particular domain-specific implementation of this class must contain the same number and type of features.
Note: Any extension must implement Serializable, if case base file save and load functionality is desired.

See Also:
Serialized Form

Field Summary
protected  FeatureCollection features
          A collection of the features.
 
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable
TITLE_FONT
 
Constructor Summary
protected Problem()
           
  Problem(FeatureCollection supplied_features)
          Creates a populated problem defaults to NOT being FeatureSpecd
 
Method Summary
 int compareTo(java.lang.Object obj)
           
 ProblemIndices constructIndices(Domain domain)
          Constructs a ProblemIndices.
 boolean equals(java.lang.Object other)
          Determine if this problem is equal to another.
 void fromXML(java.lang.String XMLString)
           
 Feature getFeature(FeatureKey key)
          Get the value of a particular feature.
 FeatureCollection getFeatures()
           
 Problem getUnestimatedCopy(Domain domain)
          Obtain a copy of this problem, not including any estimated features.
 java.lang.String toString()
          Create a string representation of this problem.
 java.lang.String toString(Domain domain)
           
 javax.swing.JComponent toSwing(Domain domain)
           
 javax.swing.JComponent toSwing(int detailLevel)
          Detail level may be ignored by implementations.
 java.lang.String toXML(Domain domain)
           
 void update(Question question, Feature answer, CCBRDomain domain)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

features

protected FeatureCollection features
A collection of the features.

Constructor Detail

Problem

protected Problem()

Problem

public Problem(FeatureCollection supplied_features)
Creates a populated problem defaults to NOT being FeatureSpecd

Method Detail

toString

public java.lang.String toString()
Create a string representation of this problem.

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(Domain domain)
Specified by:
toString in interface Featured

toSwing

public javax.swing.JComponent toSwing(int detailLevel)
Description copied from interface: SwingRepresentable
Detail level may be ignored by implementations. If used, the standard is for detailLevel 0 to be least detail, with higher values growing more detailed. 0 is least detail, higher numbers are more

Specified by:
toSwing in interface SwingRepresentable

toSwing

public javax.swing.JComponent toSwing(Domain domain)
Specified by:
toSwing in interface SwingRepresentableWithDomain

toXML

public java.lang.String toXML(Domain domain)
Specified by:
toXML in interface XMLRepresentable

fromXML

public void fromXML(java.lang.String XMLString)
Specified by:
fromXML in interface XMLRepresentable

constructIndices

public ProblemIndices constructIndices(Domain domain)
Constructs a ProblemIndices.


getFeature

public Feature getFeature(FeatureKey key)
Get the value of a particular feature.

Specified by:
getFeature in interface Featured
Parameters:
featureID - The index of the desired feature.
Returns:
An Object that is the desired feature value.

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object other)
Determine if this problem is equal to another. Two problems are equal if each individual feature is equal.

Overrides:
equals in class java.lang.Object

getFeatures

public FeatureCollection getFeatures()
Specified by:
getFeatures in interface Featured

update

public void update(Question question,
                   Feature answer,
                   CCBRDomain domain)

getUnestimatedCopy

public Problem getUnestimatedCopy(Domain domain)
Obtain a copy of this problem, not including any estimated features. A new FeatureCollection is constructed, but the features (corresponding only to definitely known features of fullProblem) are references to the same features as those in fullProblem.