home *** CD-ROM | disk | FTP | other *** search
/ Online Today 2000 January / Onto0100.iso / pc / JAVA / MSJAVX86.EXE / xmldso.cab / com / ms / xml / parser / Closure.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  1.4 KB  |  79 lines

  1. package com.ms.xml.parser;
  2.  
  3. import com.ms.xml.om.Element;
  4. import com.ms.xml.util.Atom;
  5. import com.ms.xml.util.XMLOutputStream;
  6. import java.io.IOException;
  7. import java.util.BitSet;
  8.  
  9. class Closure extends Node {
  10.    Node node;
  11.  
  12.    Closure(Node var1) {
  13.       this.node = var1;
  14.    }
  15.  
  16.    Closure() {
  17.    }
  18.  
  19.    BitSet firstpos(int var1) {
  20.       if (super.first == null) {
  21.          super.first = this.node.firstpos(var1);
  22.       }
  23.  
  24.       return super.first;
  25.    }
  26.  
  27.    BitSet lastpos(int var1) {
  28.       if (super.last == null) {
  29.          super.last = this.node.lastpos(var1);
  30.       }
  31.  
  32.       return super.last;
  33.    }
  34.  
  35.    Element toSchema(int var1, int var2, Element var3) {
  36.       ++var2;
  37.       this.node.toSchema(42, var2, var3);
  38.       --var2;
  39.       return var3;
  40.    }
  41.  
  42.    void save(XMLOutputStream var1, int var2, int var3, Atom var4) throws IOException {
  43.       if (var2 == 63 || var2 == 42) {
  44.          var1.writeChars("(");
  45.       }
  46.  
  47.       ++var3;
  48.       this.node.save(var1, 42, var3, var4);
  49.       --var3;
  50.       var1.write(42);
  51.       if (var2 == 63 || var2 == 42) {
  52.          var1.writeChars(")");
  53.       }
  54.  
  55.    }
  56.  
  57.    Node clone(ContentModel var1) {
  58.       return new Closure(this.node.clone(var1));
  59.    }
  60.  
  61.    void calcfollowpos(BitSet[] var1) {
  62.       this.node.calcfollowpos(var1);
  63.       int var2 = var1.length;
  64.       this.lastpos(var2);
  65.       this.firstpos(var2);
  66.  
  67.       for(int var3 = var1.length - 1; var3 >= 0; --var3) {
  68.          if (super.last.get(var3)) {
  69.             var1[var3].or(super.first);
  70.          }
  71.       }
  72.  
  73.    }
  74.  
  75.    boolean nullable() {
  76.       return true;
  77.    }
  78. }
  79.