home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / xalan.jar / org / apache / xalan / xpath / XBoolean.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-04-12  |  975 b   |  44 lines

  1. package org.apache.xalan.xpath;
  2.  
  3. import org.xml.sax.SAXException;
  4.  
  5. public class XBoolean extends XObject {
  6.    boolean m_val;
  7.  
  8.    public XBoolean(boolean var1) {
  9.       this.m_val = var1;
  10.    }
  11.  
  12.    public int getType() {
  13.       return 1;
  14.    }
  15.  
  16.    private String getTypeString() {
  17.       return "#BOOLEAN";
  18.    }
  19.  
  20.    public double num() {
  21.       return this.m_val ? (double)1.0F : (double)0.0F;
  22.    }
  23.  
  24.    public boolean bool() {
  25.       return this.m_val;
  26.    }
  27.  
  28.    public String str() {
  29.       return this.m_val ? "true" : "false";
  30.    }
  31.  
  32.    public Object object() {
  33.       return new Boolean(this.m_val);
  34.    }
  35.  
  36.    public boolean equals(XObject var1) throws SAXException {
  37.       if (var1.getType() == 4) {
  38.          return var1.equals(this);
  39.       } else {
  40.          return this.m_val == var1.bool();
  41.       }
  42.    }
  43. }
  44.