KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > testelement > property > NullProperty


1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/testelement/property/NullProperty.java,v 1.6 2004/02/13 02:40:53 sebb Exp $
2
/*
3  * Copyright 2003-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */

18
19 package org.apache.jmeter.testelement.property;
20
21 import org.apache.jmeter.testelement.TestElement;
22
23 /**
24  * A null property.
25  *
26  * @version $Revision: 1.6 $
27  */

28 public class NullProperty extends AbstractProperty
29 {
30     JMeterProperty tempValue;
31     
32     public NullProperty(String JavaDoc name)
33     {
34         super(name);
35     }
36     
37     public NullProperty()
38     {
39         super();
40     }
41
42     /**
43      * @see JMeterProperty#getStringValue()
44      */

45     public String JavaDoc getStringValue()
46     {
47         if(tempValue != null)
48         {
49             return tempValue.getStringValue();
50         }
51         return "";
52     }
53     
54     public void setObjectValue(Object JavaDoc v)
55     {
56     }
57
58     /**
59      * @see JMeterProperty#getObjectValue()
60      */

61     public Object JavaDoc getObjectValue()
62     {
63         return null;
64     }
65
66     /**
67      * @see JMeterProperty#isRunningVersion()
68      */

69     public boolean isRunningVersion()
70     {
71         return false;
72     }
73
74     /**
75      * see JMeterProperty#isTemporary(TestElement)
76      */

77     public boolean isTemporary(TestElement owner)
78     {
79         return true;
80     }
81
82     /**
83      * @see JMeterProperty#mergeIn(JMeterProperty)
84      */

85     public void mergeIn(JMeterProperty prop)
86     {
87         tempValue = prop;
88     }
89
90     /**
91      * @see Object#clone()
92      */

93     public Object JavaDoc clone()
94     {
95         return this;
96     }
97
98     /**
99      * @see JMeterProperty#getBooleanValue()
100      */

101     public boolean getBooleanValue()
102     {
103         return false;
104     }
105
106     /**
107      * @see JMeterProperty#getDoubleValue()
108      */

109     public double getDoubleValue()
110     {
111         return 0;
112     }
113
114     /**
115      * @see JMeterProperty#getFloatValue()
116      */

117     public float getFloatValue()
118     {
119         return 0;
120     }
121
122     /**
123      * @see JMeterProperty#getIntValue()
124      */

125     public int getIntValue()
126     {
127         return 0;
128     }
129
130     /**
131      * @see JMeterProperty#getLongValue()
132      */

133     public long getLongValue()
134     {
135         return 0;
136     }
137
138     /**
139      * @see JMeterProperty#recoverRunningVersion(TestElement)
140      */

141     public void recoverRunningVersion(TestElement owner)
142     {
143         tempValue = null;
144     }
145
146 }
147
Popular Tags