Package de.learnlib.query
Class DefaultQuery<I,D>
- java.lang.Object
-
- de.learnlib.query.Query<I,D>
-
- de.learnlib.query.AbstractQuery<I,D>
-
- de.learnlib.query.DefaultQuery<I,D>
-
- Type Parameters:
I- input symbol typeD- output domain type
public class DefaultQuery<I,D> extends AbstractQuery<I,D>
A query is a container for tests a learning algorithms performs, containing the actual test and the corresponding result.
-
-
Field Summary
-
Fields inherited from class de.learnlib.query.AbstractQuery
prefix, suffix
-
-
Constructor Summary
Constructors Constructor Description DefaultQuery(Query<I,?> query)DefaultQuery(Word<I> input)DefaultQuery(Word<I> input, D output)DefaultQuery(Word<I> prefix, Word<I> suffix)DefaultQuery(Word<I> prefix, Word<I> suffix, D output)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidanswer(D output)Answers the query.DgetOutput()booleanisNormalized()Checks if the query is normalized, i.e., if all the information is stored in thesuffixpart of the counterexample.StringtoString()Returns the string representation of this query.-
Methods inherited from class de.learnlib.query.AbstractQuery
getPrefix, getSuffix, toStringWithAnswer
-
-
-
-
Method Detail
-
getOutput
public D getOutput()
-
isNormalized
public boolean isNormalized()
Checks if the query is normalized, i.e., if all the information is stored in thesuffixpart of the counterexample.- Returns:
trueif the counterexample is normalized,falseotherwise.
-
answer
public void answer(D output)
Description copied from class:QueryAnswers the query. This method should be called by aMembershipOracle, and only once per query to process. Calling this method more than once may result in undefined behavior, possibly (but not necessarily) throwing an exception.- Specified by:
answerin classQuery<I,D>- Parameters:
output- the output, i.e., the directly observable response to the query's suffix (cf.main documentation)
-
toString
public String toString()
Description copied from class:QueryReturns the string representation of this query.- Overrides:
toStringin classQuery<I,D>- Returns:
- A string of the form
"Query[<prefix>|<suffix>]"for queries not containing an answer or"Query[<prefix>|<suffix> / <answer>]"if an answer may be specified. - See Also:
AbstractQuery.toStringWithAnswer(Object)
-
-