From: David ‘Bombe’ Roden Date: Wed, 2 Jan 2013 10:40:47 +0000 (+0100) Subject: Add an update interval to a reaction. X-Git-Tag: 0.1~117 X-Git-Url: https://git.pterodactylus.net/?p=rhynodge.git;a=commitdiff_plain;h=4aa0a149254611a863c784069e4ca0b7ca9b9e8f Add an update interval to a reaction. --- diff --git a/src/main/java/net/pterodactylus/reactor/Reaction.java b/src/main/java/net/pterodactylus/reactor/Reaction.java index 0e0b359..f7a8c2c 100644 --- a/src/main/java/net/pterodactylus/reactor/Reaction.java +++ b/src/main/java/net/pterodactylus/reactor/Reaction.java @@ -42,6 +42,9 @@ public class Reaction { /** The previous state of the query. */ private S previousState; + /** The interval in which to run queries (in milliseconds). */ + private long updateInterval; + /** * Creates a new reaction. * @@ -107,4 +110,25 @@ public class Reaction { return previousState; } + /** + * Returns the update interval of this reaction. + * + * @return The update interval of this reaction (in milliseconds) + */ + public long updateInterval() { + return updateInterval; + } + + /** + * Sets the update interval of this reaction. + * + * @param updateInterval + * The update interval of this reaction (in milliseconds) + * @return This reaction + */ + public Reaction setUpdateInterval(long updateInterval) { + this.updateInterval = updateInterval; + return this; + } + }