KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xpath > objects > XBooleanStatic


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
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 /*
17  * $Id: XBooleanStatic.java,v 1.10 2004/02/17 04:34:38 minchau 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 {
28
29   /** The value of the object.
30    * @serial */

31   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
41     super(b);
42
43     m_val = b;
44   }
45
46   /**
47    * Tell if two objects are functionally equal.
48    *
49    * @param obj2 Object to compare to this
50    *
51    * @return True if the two objects are equal
52    *
53    * @throws javax.xml.transform.TransformerException
54    */

55   public boolean equals(XObject obj2)
56   {
57     try
58     {
59       return m_val == obj2.bool();
60     }
61     catch(javax.xml.transform.TransformerException JavaDoc te)
62     {
63       throw new org.apache.xml.utils.WrappedRuntimeException(te);
64     }
65   }
66 }
67
Popular Tags