Class AbstractQuery<I,​D>

  • Direct Known Subclasses:
    DefaultQuery

    public abstract class AbstractQuery<I,​D>
    extends Query<I,​D>
    • Field Detail

      • prefix

        protected final Word<I> prefix
      • suffix

        protected final Word<I> suffix
    • Constructor Detail

      • AbstractQuery

        public AbstractQuery​(Word<I> queryWord)
      • AbstractQuery

        public AbstractQuery​(Word<I> prefix,
                             Word<I> suffix)
      • AbstractQuery

        public AbstractQuery​(Query<I,​?> query)
    • Method Detail

      • getPrefix

        public Word<I> getPrefix()
        Description copied from class: Query
        Returns the prefix part of this query. The prefix of a query is responsible for transferring the system into a certain state, but (apart from that) does not directly influence the output.
        Specified by:
        getPrefix in class Query<I,​D>
        Returns:
        the prefix of this query
      • getSuffix

        public Word<I> getSuffix()
        Description copied from class: Query
        Returns the suffix part of this query. The suffix of a query is the experiment performed on the system when in the state it was transferred into by the prefix, and thus directly influences the output.
        Specified by:
        getSuffix in class Query<I,​D>
        Returns:
        the suffix of this query
      • toStringWithAnswer

        public String toStringWithAnswer​(D answer)
        Returns the string representation of this query, including a possible answer. This method should be used by classes extending AbstractQuery for their toString method to ensure output consistency.
        Returns:
        A string of the form "Query[<prefix>|<suffix> / <answer>]". If the query has not been answered yet, <answer> will be null.