Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.conversations.InactivityConversationCanceller Class Reference
Inheritance diagram for org.bukkit.conversations.InactivityConversationCanceller:
org.bukkit.conversations.ConversationCanceller

Public Member Functions

 InactivityConversationCanceller (Plugin plugin, int timeoutSeconds)
 
void setConversation (Conversation conversation)
 
boolean cancelBasedOnInput (ConversationContext context, String input)
 
ConversationCanceller clone ()
 

Protected Member Functions

void cancelling (Conversation conversation)
 

Protected Attributes

Plugin plugin
 
int timeoutSeconds
 
Conversation conversation
 

Detailed Description

An InactivityConversationCanceller will cancel a Conversation after a period of inactivity by the user.

Definition at line 10 of file InactivityConversationCanceller.java.

Constructor & Destructor Documentation

org.bukkit.conversations.InactivityConversationCanceller.InactivityConversationCanceller ( Plugin  plugin,
int  timeoutSeconds 
)

Creates an InactivityConversationCanceller.

Parameters
pluginThe owning plugin.
timeoutSecondsThe number of seconds of inactivity to wait.

Definition at line 22 of file InactivityConversationCanceller.java.

Referenced by org.bukkit.conversations.InactivityConversationCanceller.clone().

22  {
23  this.plugin = plugin;
24  this.timeoutSeconds = timeoutSeconds;
25  }

Member Function Documentation

boolean org.bukkit.conversations.InactivityConversationCanceller.cancelBasedOnInput ( ConversationContext  context,
String  input 
)

Cancels a conversation based on user input.

Parameters
contextContext information about the conversation.
inputThe input text from the user.
Returns
True to cancel the conversation, False otherwise.

Implements org.bukkit.conversations.ConversationCanceller.

Definition at line 32 of file InactivityConversationCanceller.java.

32  {
33  // Reset the inactivity timer
34  stopTimer();
35  startTimer();
36  return false;
37  }
void org.bukkit.conversations.InactivityConversationCanceller.cancelling ( Conversation  conversation)
protected

Subclasses of InactivityConversationCanceller can override this method to take additional actions when the inactivity timer abandons the conversation.

Parameters
conversationThe conversation being abandoned.

Definition at line 76 of file InactivityConversationCanceller.java.

76  {
77 
78  }
ConversationCanceller org.bukkit.conversations.InactivityConversationCanceller.clone ( )

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

Implementing this method should reset any internal object state.

Returns
A clone.

Implements org.bukkit.conversations.ConversationCanceller.

Definition at line 39 of file InactivityConversationCanceller.java.

References org.bukkit.conversations.InactivityConversationCanceller.InactivityConversationCanceller().

39  {
40  return new InactivityConversationCanceller(plugin, timeoutSeconds);
41  }
void org.bukkit.conversations.InactivityConversationCanceller.setConversation ( Conversation  conversation)

Sets the conversation this ConversationCanceller can optionally cancel.

Parameters
conversationA conversation.

Implements org.bukkit.conversations.ConversationCanceller.

Definition at line 27 of file InactivityConversationCanceller.java.

27  {
28  this.conversation = conversation;
29  startTimer();
30  }

The documentation for this class was generated from the following file: