01: /*
02: * Copyright 1999-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: /*
17: * $Id: XBooleanStatic.java,v 1.12 2004/12/15 17:35:55 jycli Exp $
18: */
19: package org.apache.xpath.objects;
20:
21: /**
22: * This class doesn't have any XPathContext, so override
23: * whatever to ensure it works OK.
24: * @xsl.usage internal
25: */
26: public class XBooleanStatic extends XBoolean {
27: static final long serialVersionUID = -8064147275772687409L;
28:
29: /** The value of the object.
30: * @serial */
31: private final boolean m_val;
32:
33: /**
34: * Construct a XBooleanStatic object.
35: *
36: * @param b The value of the object
37: */
38: public XBooleanStatic(boolean b) {
39:
40: super (b);
41:
42: m_val = b;
43: }
44:
45: /**
46: * Tell if two objects are functionally equal.
47: *
48: * @param obj2 Object to compare to this
49: *
50: * @return True if the two objects are equal
51: *
52: * @throws javax.xml.transform.TransformerException
53: */
54: public boolean equals(XObject obj2) {
55: try {
56: return m_val == obj2.bool();
57: } catch (javax.xml.transform.TransformerException te) {
58: throw new org.apache.xml.utils.WrappedRuntimeException(te);
59: }
60: }
61: }
|