com.languagecomputer.api.text
Class DefaultQuestionAnswerPair

java.lang.Object
  extended by com.languagecomputer.api.text.DefaultText
      extended by com.languagecomputer.api.text.DefaultQuestionAnswerPair
All Implemented Interfaces:
QuestionAnswerPair, Text

public class DefaultQuestionAnswerPair
extends DefaultText
implements QuestionAnswerPair

Default implementation of an QuestionAnswerPair.

Since:
1.0
Author:
Kirk Roberts
See Also:
DefaultText

Field Summary
 
Fields inherited from interface com.languagecomputer.api.text.QuestionAnswerPair
TYPE
 
Constructor Summary
DefaultQuestionAnswerPair()
          Creates a new DefaultQuestionAnswerPair.
 
Method Summary
 Text getAnswer()
          Returns the answer Text for this QuestionAnswerPair.
 String getQuestion()
          Returns the question for this QuestionAnswerPair.
 void setAnnotationType(AnnotationType annType)
          Not necessary: defaults to QuestionAnswerPair.TYPE.
 void setAnswer(Text answer)
          Sets the answer to use for this QuestionAnswerPair.
 void setQuestion(String question)
          Sets the question to use for this QuestionAnswerPair.
 String toString()
          Returns a String representation of a DefaultQuestionAnswerPair.
 
Methods inherited from class com.languagecomputer.api.text.DefaultText
getAnnotationType, getCongruentAnnotations, getDocument, getDocumentID, getEndCharOffset, getIntersectingAnnotations, getRawString, getStartCharOffset, getSubAnnotations, getSuperAnnotations, setDocument, setEndCharOffset, setRawString, setStartCharOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.languagecomputer.api.text.Text
getAnnotationType, getCongruentAnnotations, getDocument, getDocumentID, getEndCharOffset, getIntersectingAnnotations, getRawString, getStartCharOffset, getSubAnnotations, getSuperAnnotations
 

Constructor Detail

DefaultQuestionAnswerPair

public DefaultQuestionAnswerPair()
Creates a new DefaultQuestionAnswerPair.

Method Detail

setAnnotationType

public void setAnnotationType(AnnotationType annType)
Not necessary: defaults to QuestionAnswerPair.TYPE.

Overrides:
setAnnotationType in class DefaultText
Parameters:
annType - AnnotationType to use for this DefaultQuestionAnswerPair.
See Also:
Text.getAnnotationType(), AnnotationType

setQuestion

public void setQuestion(String question)
Sets the question to use for this QuestionAnswerPair.

Parameters:
question - The question for this QuestionAnswerPair.
See Also:
getQuestion()

getQuestion

public String getQuestion()
Returns the question for this QuestionAnswerPair.

Specified by:
getQuestion in interface QuestionAnswerPair
Returns:
The generated question String.

setAnswer

public void setAnswer(Text answer)
Sets the answer to use for this QuestionAnswerPair.

Parameters:
answer - The answer Text for this QuestionAnswerPair.
See Also:
getAnswer()

getAnswer

public Text getAnswer()
Returns the answer Text for this QuestionAnswerPair.

Specified by:
getAnswer in interface QuestionAnswerPair
Returns:
The extracted answer Text.

toString

public String toString()
Returns a String representation of a DefaultQuestionAnswerPair.

Overrides:
toString in class DefaultText


Copyright © 2009. All Rights Reserved.