Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/org/dive4elements/artifactdatabase/DefaultPreferredLocale.java @ 473:d0ac790a6c89 dive4elements-move
Moved directories to org.dive4elements
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 10:57:18 +0200 |
parents | artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultPreferredLocale.java@933bbc9fc11f |
children | 415df0fc4fa1 |
comparison
equal
deleted
inserted
replaced
472:783cc1b6b615 | 473:d0ac790a6c89 |
---|---|
1 /* | |
2 * Copyright (c) 2010 by Intevation GmbH | |
3 * | |
4 * This program is free software under the LGPL (>=v2.1) | |
5 * Read the file LGPL.txt coming with the software for details | |
6 * or visit http://www.gnu.org/licenses/ if it does not exist. | |
7 */ | |
8 | |
9 package de.intevation.artifactdatabase; | |
10 | |
11 import de.intevation.artifacts.PreferredLocale; | |
12 | |
13 import java.util.Locale; | |
14 | |
15 /** | |
16 * Models a pair of Locale and quality (0.0-1.0) to be used to | |
17 * find best matching locale between server offerings and clients requests. | |
18 * | |
19 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> | |
20 */ | |
21 public class DefaultPreferredLocale | |
22 implements PreferredLocale | |
23 { | |
24 /** | |
25 * The locale of this tuple pair. | |
26 */ | |
27 protected Locale locale; | |
28 /** | |
29 * The quality of this tuple pair between 0.0 and 1.0. | |
30 */ | |
31 protected float quality; | |
32 | |
33 /** | |
34 * Default constructor | |
35 */ | |
36 public DefaultPreferredLocale() { | |
37 } | |
38 | |
39 /** | |
40 * Constructor to build a pair of given a locale speficied by | |
41 * string 'lang' and an given 'quality'. | |
42 * @param lang The name of the locale. | |
43 * @param quality The quality of the locale. | |
44 */ | |
45 public DefaultPreferredLocale(String lang, float quality) { | |
46 locale = new Locale(lang); | |
47 this.quality = quality; | |
48 } | |
49 | |
50 public Locale getLocale() { | |
51 return locale; | |
52 } | |
53 | |
54 public float getQuality() { | |
55 return quality; | |
56 } | |
57 } | |
58 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |