Class AbstractQuery

java.lang.Object
org.eu.zajc.akiwrapper.core.entities.impl.AbstractQuery
All Implemented Interfaces:
Query
Direct Known Subclasses:
GuessImpl, QuestionImpl

public abstract class AbstractQuery extends Object implements Query
Note: This is an internal class and its internals are subject to change without prior deprecation. Use with caution.

Author:
Marko Zajc
  • Constructor Details

    • AbstractQuery

      protected AbstractQuery(@Nonnull AkiwrapperImpl akiwrapper, int step, double progression)
  • Method Details

    • ensureCurrent

      protected void ensureCurrent()
    • parseNext

      public Query parseNext(@Nonnull Response<org.json.JSONObject> resp)
    • getAkiwrapper

      public AkiwrapperImpl getAkiwrapper()
      Specified by:
      getAkiwrapper in interface Query
      Returns:
      the Akiwrapper instance.
    • getStep

      public int getStep()
      Description copied from interface: Query
      Returns the current step (question number). This uses zero-based index, meaning the first question will be on step 0. Answering a Question increments the step, and undoing a Question decrements it. Guesses will have the same step as the previous Question, and rejecting them will not increment the step.
      Specified by:
      getStep in interface Query
      Returns:
      current step.
    • getProgression

      public double getProgression()
      Description copied from interface: Query
      Current completion percentage (as a double). A higher value means that Akinator believes it is closer to the correct answer. Guesses will have the same prorgession as the previous Question.
      The value ranges between 0 and 100.
      Specified by:
      getProgression in interface Query
      Returns:
      completion percentage.