edu.indiana.iucbrf.ccbr.conversationblock
Class QuestionImpl

java.lang.Object
  extended by edu.indiana.iucbrf.ccbr.conversationblock.QuestionImpl
All Implemented Interfaces:
ConversationBlock, Question, SwingRepresentable, java.io.Serializable

public class QuestionImpl
extends java.lang.Object
implements Question, java.io.Serializable, SwingRepresentable

A Question is a conversation block that contains some text (the question text) and also a feature key, which corresponds to the type of the answer expected.

See Also:
Serialized Form

Field Summary
protected  FeatureKey featureKey
           
static int LABEL_WIDTH
           
protected  java.lang.String text
           
 
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable
TITLE_FONT
 
Constructor Summary
protected QuestionImpl()
           
  QuestionImpl(FeatureKey featureKey, java.lang.String text)
          Creates a new instance of Question
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getButtonText()
           
 FeatureInputPanel getFeatureInputPanel(CCBRDomain domain, boolean allowUnknowns)
           
 FeatureKey getFeatureKey()
           
 java.lang.String getText()
           
 java.lang.String toString()
           
 javax.swing.JComponent toSwing(int detailLevel)
          Detail level may be ignored by implementations.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LABEL_WIDTH

public static final int LABEL_WIDTH
See Also:
Constant Field Values

text

protected java.lang.String text

featureKey

protected FeatureKey featureKey
Constructor Detail

QuestionImpl

protected QuestionImpl()

QuestionImpl

public QuestionImpl(FeatureKey featureKey,
                    java.lang.String text)
Creates a new instance of Question

Method Detail

getText

public java.lang.String getText()
Specified by:
getText in interface ConversationBlock

getFeatureKey

public FeatureKey getFeatureKey()
Specified by:
getFeatureKey in interface Question

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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

getFeatureInputPanel

public FeatureInputPanel getFeatureInputPanel(CCBRDomain domain,
                                              boolean allowUnknowns)
Specified by:
getFeatureInputPanel in interface ConversationBlock

getButtonText

public java.lang.String getButtonText()
Specified by:
getButtonText in interface ConversationBlock

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object