From 625207710d70787f451e952c4f841722b08eb6c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 28 May 2008 15:53:58 +0200 Subject: [PATCH] change override list to map add override management methods --- src/net/pterodactylus/jsite/project/Project.java | 30 ++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/net/pterodactylus/jsite/project/Project.java b/src/net/pterodactylus/jsite/project/Project.java index d6a319d..b80c293 100644 --- a/src/net/pterodactylus/jsite/project/Project.java +++ b/src/net/pterodactylus/jsite/project/Project.java @@ -20,8 +20,8 @@ package net.pterodactylus.jsite.project; import java.beans.PropertyChangeListener; -import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; +import java.util.Map; import net.pterodactylus.util.beans.AbstractBean; @@ -67,7 +67,7 @@ public class Project extends AbstractBean { private String basePath; /** The overrides. */ - private final List overrides = new ArrayList(); + private final Map overrides = new HashMap(); /** * Creates a new project. @@ -214,11 +214,33 @@ public class Project extends AbstractBean { } /** + * Adds an override for the given file. + * + * @param filePath + * The file path + * @param override + * The override for the file + */ + public void addOverride(String filePath, Override override) { + overrides.put(filePath, override); + } + + /** + * Removes the override for the given file. + * + * @param filePath + * The file path for which to remove the override + */ + public void removeOverride(String filePath) { + overrides.remove(filePath); + } + + /** * Returns the list of {@link Override}s. * * @return All overrides */ - public List getOverrides() { + public Map getOverrides() { return overrides; } -- 2.7.4