类 InactivityConversationCanceller

java.lang.Object
org.bukkit.conversations.InactivityConversationCanceller
所有已实现的接口:
Cloneable, ConversationCanceller

public class InactivityConversationCanceller extends Object implements ConversationCanceller
An InactivityConversationCanceller will cancel a Conversation after a period of inactivity by the user.
  • 字段详细资料

    • plugin

      protected Plugin plugin
    • timeoutSeconds

      protected int timeoutSeconds
    • conversation

      protected Conversation conversation
  • 构造器详细资料

    • InactivityConversationCanceller

      public InactivityConversationCanceller(Plugin plugin, int timeoutSeconds)
      Creates an InactivityConversationCanceller.
      参数:
      plugin - The owning plugin.
      timeoutSeconds - The number of seconds of inactivity to wait.
  • 方法详细资料

    • setConversation

      public void setConversation(Conversation conversation)
      从接口复制的说明: ConversationCanceller
      设置本ConversationCanceller可以取消的会话.

      原文:Sets the conversation this ConversationCanceller can optionally cancel.

      指定者:
      setConversation 在接口中 ConversationCanceller
      参数:
      conversation - 一个会话
    • cancelBasedOnInput

      public boolean cancelBasedOnInput(ConversationContext context, String input)
      从接口复制的说明: ConversationCanceller
      根据用户的输入反馈取消一个会话.

      原文:Cancels a conversation based on user input.

      指定者:
      cancelBasedOnInput 在接口中 ConversationCanceller
      参数:
      context - 关于会话的Context信息
      input - 用户的输入值
      返回:
      true取消该会话,false反之
    • clone

      public ConversationCanceller clone()
      从接口复制的说明: ConversationCanceller
      允许某一ConversationFactory在创建一个新Conversation时 复制这个ConversationCanceller.

      实现这个方法应当重置一切内部的对象状态.

      原文:Allows the ConversationFactory to duplicate this ConversationCanceller when creating a new Conversation.

      Implementing this method should reset any internal object state.

      指定者:
      clone 在接口中 ConversationCanceller
      覆盖:
      clone 在类中 Object
      返回:
      一个副本
    • cancelling

      protected void cancelling(Conversation conversation)
      Subclasses of InactivityConversationCanceller can override this method to take additional actions when the inactivity timer abandons the conversation.
      参数:
      conversation - The conversation being abandoned.