KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > dozer > util > mapping > vo > DoubleObject


1 /*
2  * Copyright 2005-2007 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package net.sf.dozer.util.mapping.vo;
17
18 import java.io.Serializable JavaDoc;
19
20 /**
21  * @author garsombke.franz
22  * @author sullins.ben
23  * @author tierney.matt
24  *
25  */

26 public class DoubleObject implements Serializable JavaDoc {
27   private double value;
28
29   public DoubleObject() {
30   }
31
32   public DoubleObject(double value) {
33     this.value = value;
34   }
35
36   public double getValue() {
37     return value;
38   }
39
40   public void setValue(double value) {
41     this.value = value;
42   }
43
44   public boolean equals(Object JavaDoc o) {
45     if (this == o)
46       return true;
47     if (!(o instanceof DoubleObject))
48       return false;
49
50     final DoubleObject doubleObject = (DoubleObject) o;
51
52     if (value != doubleObject.value)
53       return false;
54
55     return true;
56   }
57
58   public int hashCode() {
59     final long temp = value != +0.0d ? Double.doubleToLongBits(value) : 0l;
60     return (int) (temp ^ (temp >>> 32));
61   }
62
63   public String JavaDoc toString() {
64     return String.valueOf(value);
65   }
66
67 }
Popular Tags