home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / xml4j.jar / com / ibm / xml / parser / CMLeaf.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-08-30  |  1.4 KB  |  84 lines

  1. package com.ibm.xml.parser;
  2.  
  3. import java.util.BitSet;
  4.  
  5. public class CMLeaf extends CMNode {
  6.    static final long serialVersionUID = 8334965779973489245L;
  7.    String name;
  8.    int position;
  9.    int maxPosition;
  10.  
  11.    public CMLeaf(String var1) {
  12.       this.name = var1;
  13.    }
  14.  
  15.    public String getName() {
  16.       return this.name;
  17.    }
  18.  
  19.    public String toString() {
  20.       return this.name;
  21.    }
  22.  
  23.    CMNode cloneNode() {
  24.       CMLeaf var1 = new CMLeaf(this.name);
  25.       var1.position = this.position;
  26.       var1.maxPosition = this.maxPosition;
  27.       return var1;
  28.    }
  29.  
  30.    void setPosition(int var1) {
  31.       this.position = var1;
  32.    }
  33.  
  34.    int getPosition() {
  35.       return this.position;
  36.    }
  37.  
  38.    boolean nullable() {
  39.       if (super.nullable == null) {
  40.          super.nullable = new Boolean(false);
  41.       }
  42.  
  43.       return false;
  44.    }
  45.  
  46.    BitSet firstpos() {
  47.       if (super.firstPos == null) {
  48.          super.firstPos = new BitSet(this.maxPosition);
  49.          super.firstPos.set(this.position);
  50.       }
  51.  
  52.       return super.firstPos;
  53.    }
  54.  
  55.    BitSet lastpos() {
  56.       if (super.lastPos == null) {
  57.          super.lastPos = new BitSet(this.maxPosition);
  58.          super.lastPos.set(this.position);
  59.       }
  60.  
  61.       return super.lastPos;
  62.    }
  63.  
  64.    void prepare(int var1) {
  65.       this.maxPosition = var1;
  66.    }
  67.  
  68.    void setFollowpos(BitSet[] var1) {
  69.    }
  70.  
  71.    public boolean equals(Object var1) {
  72.       if (!(var1 instanceof CMLeaf)) {
  73.          return false;
  74.       } else {
  75.          CMLeaf var2 = (CMLeaf)var1;
  76.          return var2.getName().equals(this.getName());
  77.       }
  78.    }
  79.  
  80.    public int hashCode() {
  81.       return this.getName().hashCode();
  82.    }
  83. }
  84.