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 void
answer(D output)
Answers the query.D
getOutput()
boolean
isNormalized()
Checks if the query is normalized, i.e., if all the information is stored in thesuffix
part of the counterexample.String
toString()
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 thesuffix
part of the counterexample.- Returns:
true
if the counterexample is normalized,false
otherwise.
-
answer
public void answer(D output)
Description copied from class:Query
Answers 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:
answer
in 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:Query
Returns the string representation of this query.- Overrides:
toString
in 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)
-
-