From: David ‘Bombe’ Roden Date: Wed, 28 May 2008 13:53:58 +0000 (+0200) Subject: change override list to map X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=625207710d70787f451e952c4f841722b08eb6c9;p=jSite2.git change override list to map add override management methods --- 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; }