From 4a7be787698608af487dbe4ae124d5bb541eb84c Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Sat, 14 Apr 2012 21:00:25 +0200 Subject: refactoring: encapsulate exports * no more public classes, only ExportFactory * exports can be garbage collected immediately after use --- main/src/cgeo/geocaching/export/AbstractExport.java | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'main/src/cgeo/geocaching/export/AbstractExport.java') diff --git a/main/src/cgeo/geocaching/export/AbstractExport.java b/main/src/cgeo/geocaching/export/AbstractExport.java index c5bf3c0..85b060b 100644 --- a/main/src/cgeo/geocaching/export/AbstractExport.java +++ b/main/src/cgeo/geocaching/export/AbstractExport.java @@ -2,8 +2,8 @@ package cgeo.geocaching.export; import cgeo.geocaching.cgeoapplication; -public abstract class AbstractExport implements Export { - private String name; +abstract class AbstractExport implements Export { + private final String name; protected AbstractExport(final String name) { this.name = name; @@ -14,13 +14,19 @@ public abstract class AbstractExport implements Export { } /** - * Generates a localized string from a ressource id. + * Generates a localized string from a resource id. * - * @param ressourceId - * the ressource id of the string + * @param resourceId + * the resource id of the string * @return localized string */ - protected static String getString(int ressourceId) { - return cgeoapplication.getInstance().getString(ressourceId); + protected static String getString(int resourceId) { + return cgeoapplication.getInstance().getString(resourceId); + } + + @Override + public String toString() { + // used in the array adapter of the dialog showing the exports + return getName(); } } -- cgit v1.1