From 1cefd03b611b9c5b9ee3ac0690a941a04eb6b1a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 18 Apr 2012 06:59:23 +0200 Subject: [PATCH] Add method to check whether attributes have been modified. --- .../java/net/pterodactylus/demoscenemusic/data/AbstractBase.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java b/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java index 6a21081..a2c0f63 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java @@ -47,6 +47,15 @@ public class AbstractBase { return (Value) attributes.get(name); } + protected boolean dirty() { + for (Value value : attributes.values()) { + if (value.dirty()) { + return true; + } + } + return false; + } + protected static class Value { private T original; -- 2.7.4