KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > vfs > metadata > value > ValueValue


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.vfs.metadata.value;
20
21 import org.openharmonise.vfs.metadata.*;
22
23 /**
24  * This is the value for vocabulary type properties.
25  *
26  * @author Matthew Large
27  * @version $Revision: 1.1 $
28  *
29  */

30 public class ValueValue implements ValueInstance {
31     
32     /**
33      * Value.
34      */

35     private String JavaDoc m_sHREF = null;
36
37     public ValueValue() {
38         super();
39     }
40
41     /**
42      * Constructs a new vocabulary type value.
43      *
44      * @param sHREF Value
45      */

46     public ValueValue(String JavaDoc sHREF) {
47         super();
48         this.m_sHREF = sHREF;
49     }
50     
51     /**
52      * Returns the value.
53      *
54      * @return Value
55      */

56     public String JavaDoc getValue() {
57         return this.m_sHREF;
58     }
59     
60     /**
61      * Sets the value.
62      *
63      * @param sHREF Value
64      */

65     public void setValue(String JavaDoc sHREF) {
66         this.m_sHREF = sHREF;
67     }
68     
69     /* (non-Javadoc)
70      * @see java.lang.Object#equals(java.lang.Object)
71      */

72     public boolean equals(Object JavaDoc arg0) {
73         if(super.equals(arg0)) {
74             return true;
75         } else if(arg0 instanceof ValueValue) {
76             ValueValue val = (ValueValue)arg0;
77             if(val.getValue().equals(this.m_sHREF)) {
78                 return true;
79             } else {
80                 return false;
81             }
82         } else {
83             return false;
84         }
85     }
86     
87     public String JavaDoc toString() {
88         return m_sHREF;
89     }
90
91 }
92
Popular Tags