4544 |
25 Sep 08 |
nicklas |
1 |
/** |
4544 |
25 Sep 08 |
nicklas |
$Id$ |
4544 |
25 Sep 08 |
nicklas |
3 |
|
4544 |
25 Sep 08 |
nicklas |
Copyright (C) 2008 Nicklas Nordborg |
4544 |
25 Sep 08 |
nicklas |
5 |
|
4544 |
25 Sep 08 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
4544 |
25 Sep 08 |
nicklas |
Available at http://base.thep.lu.se/ |
4544 |
25 Sep 08 |
nicklas |
8 |
|
4544 |
25 Sep 08 |
nicklas |
BASE is free software; you can redistribute it and/or |
4544 |
25 Sep 08 |
nicklas |
modify it under the terms of the GNU General Public License |
4544 |
25 Sep 08 |
nicklas |
as published by the Free Software Foundation; either version 3 |
4544 |
25 Sep 08 |
nicklas |
of the License, or (at your option) any later version. |
4544 |
25 Sep 08 |
nicklas |
13 |
|
4544 |
25 Sep 08 |
nicklas |
BASE is distributed in the hope that it will be useful, |
4544 |
25 Sep 08 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4544 |
25 Sep 08 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4544 |
25 Sep 08 |
nicklas |
GNU General Public License for more details. |
4544 |
25 Sep 08 |
nicklas |
18 |
|
4544 |
25 Sep 08 |
nicklas |
You should have received a copy of the GNU General Public License |
4544 |
25 Sep 08 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
4544 |
25 Sep 08 |
nicklas |
21 |
*/ |
4544 |
25 Sep 08 |
nicklas |
22 |
package net.sf.basedb.util.units; |
4544 |
25 Sep 08 |
nicklas |
23 |
|
4544 |
25 Sep 08 |
nicklas |
24 |
/** |
4544 |
25 Sep 08 |
nicklas |
A unit "converter" that doesn't modify the values. |
4544 |
25 Sep 08 |
nicklas |
26 |
|
4544 |
25 Sep 08 |
nicklas |
@author Nicklas |
4544 |
25 Sep 08 |
nicklas |
@version 2.9 |
4544 |
25 Sep 08 |
nicklas |
@base.modified $Date$ |
4544 |
25 Sep 08 |
nicklas |
30 |
*/ |
4544 |
25 Sep 08 |
nicklas |
31 |
public class IdentityUnitConverter |
4544 |
25 Sep 08 |
nicklas |
32 |
implements UnitConverter |
4544 |
25 Sep 08 |
nicklas |
33 |
{ |
4544 |
25 Sep 08 |
nicklas |
34 |
|
4544 |
25 Sep 08 |
nicklas |
35 |
/** |
4544 |
25 Sep 08 |
nicklas |
Create a new unit converter. |
4544 |
25 Sep 08 |
nicklas |
37 |
*/ |
4544 |
25 Sep 08 |
nicklas |
38 |
public IdentityUnitConverter() |
4544 |
25 Sep 08 |
nicklas |
39 |
{} |
4544 |
25 Sep 08 |
nicklas |
40 |
|
4544 |
25 Sep 08 |
nicklas |
41 |
/** |
4544 |
25 Sep 08 |
nicklas |
From the UnitConverter interface |
4544 |
25 Sep 08 |
nicklas |
43 |
-------------------------------- |
4544 |
25 Sep 08 |
nicklas |
44 |
*/ |
4544 |
25 Sep 08 |
nicklas |
45 |
/** |
4544 |
25 Sep 08 |
nicklas |
@return The 'specific' value unmodified |
4544 |
25 Sep 08 |
nicklas |
47 |
*/ |
6127 |
14 Sep 12 |
nicklas |
48 |
@Override |
4544 |
25 Sep 08 |
nicklas |
49 |
public double convertToReferenceUnit(double specific) |
4544 |
25 Sep 08 |
nicklas |
50 |
{ |
4544 |
25 Sep 08 |
nicklas |
51 |
return specific; |
4544 |
25 Sep 08 |
nicklas |
52 |
} |
4544 |
25 Sep 08 |
nicklas |
53 |
/** |
4544 |
25 Sep 08 |
nicklas |
@return The 'ref' value unmodified |
4544 |
25 Sep 08 |
nicklas |
55 |
*/ |
6127 |
14 Sep 12 |
nicklas |
56 |
@Override |
4544 |
25 Sep 08 |
nicklas |
57 |
public double convertToSpecificUnit(double ref) |
4544 |
25 Sep 08 |
nicklas |
58 |
{ |
4544 |
25 Sep 08 |
nicklas |
59 |
return ref; |
4544 |
25 Sep 08 |
nicklas |
60 |
} |
4544 |
25 Sep 08 |
nicklas |
61 |
// ----------------------------------- |
4544 |
25 Sep 08 |
nicklas |
62 |
|
4544 |
25 Sep 08 |
nicklas |
63 |
} |