From 4aa0a149254611a863c784069e4ca0b7ca9b9e8f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 2 Jan 2013 11:40:47 +0100 Subject: [PATCH] Add an update interval to a reaction. --- .../java/net/pterodactylus/reactor/Reaction.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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; + } + } -- 2.7.4