ingo@100: /* ingo@100: * Copyright (c) 2010 by Intevation GmbH ingo@100: * ingo@100: * This program is free software under the LGPL (>=v2.1) ingo@100: * Read the file LGPL.txt coming with the software for details ingo@100: * or visit http://www.gnu.org/licenses/ if it does not exist. ingo@100: */ ingo@100: sascha@48: package de.intevation.artifactdatabase; sascha@48: sascha@48: import de.intevation.artifacts.PreferredLocale; sascha@48: sascha@48: import java.util.Locale; sascha@48: sascha@48: /** sascha@89: * Models a pair of Locale and quality (0.0-1.0) to be used to sascha@89: * find best matching locale between server offerings and clients requests. sascha@90: * sascha@77: * @author Sascha L. Teichmann sascha@48: */ sascha@48: public class DefaultPreferredLocale sascha@48: implements PreferredLocale sascha@48: { sascha@89: /** sascha@89: * The locale of this tuple pair. sascha@89: */ sascha@48: protected Locale locale; sascha@89: /** sascha@89: * The quality of this tuple pair between 0.0 and 1.0. sascha@89: */ sascha@48: protected float quality; sascha@48: sascha@89: /** sascha@89: * Default constructor sascha@89: */ sascha@48: public DefaultPreferredLocale() { sascha@48: } sascha@48: sascha@89: /** sascha@89: * Constructor to build a pair of given a locale speficied by sascha@89: * string 'lang' and an given 'quality'. sascha@89: * @param lang The name of the locale. sascha@89: * @param quality The quality of the locale. sascha@89: */ sascha@48: public DefaultPreferredLocale(String lang, float quality) { sascha@48: locale = new Locale(lang); sascha@48: this.quality = quality; sascha@48: } sascha@48: sascha@48: public Locale getLocale() { sascha@48: return locale; sascha@48: } sascha@48: sascha@48: public float getQuality() { sascha@48: return quality; sascha@48: } sascha@48: } sascha@89: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :