01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: package org.apache.tools.ant.taskdefs.optional.depend.constantpool;
19:
20: /**
21: * A Constant Pool entry which represents a constant value.
22: *
23: */
24: public abstract class ConstantCPInfo extends ConstantPoolEntry {
25:
26: /**
27: * The entry's untyped value. Each subclass interprets the constant
28: * value based on the subclass's type. The value here must be
29: * compatible.
30: */
31: private Object value;
32:
33: /**
34: * Initialise the constant entry.
35: *
36: * @param tagValue the constant pool entry type to be used.
37: * @param entries the number of constant pool entry slots occupied by
38: * this entry.
39: */
40: protected ConstantCPInfo(int tagValue, int entries) {
41: super (tagValue, entries);
42: }
43:
44: /**
45: * Get the value of the constant.
46: *
47: * @return the value of the constant (untyped).
48: */
49: public Object getValue() {
50: return value;
51: }
52:
53: /**
54: * Set the constant value.
55: *
56: * @param newValue the new untyped value of this constant.
57: */
58: public void setValue(Object newValue) {
59: value = newValue;
60: }
61:
62: }
|