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

  1. package com.ms.xml.util;
  2.  
  3. import java.util.Enumeration;
  4. import java.util.Vector;
  5.  
  6. public class ReadOnlyAttributes {
  7.    Vector attributes;
  8.  
  9.    public Enumeration attributes() {
  10.       return this.attributes.elements();
  11.    }
  12.  
  13.    public Object get(Name var1) {
  14.       Attribute var2 = this.lookup(var1);
  15.       return var2 == null ? null : var2.getValue();
  16.    }
  17.  
  18.    public String toString() {
  19.       return this.getClass().getName();
  20.    }
  21.  
  22.    public ReadOnlyAttributes() {
  23.       this.attributes = new Vector();
  24.    }
  25.  
  26.    public ReadOnlyAttributes(Vector var1) {
  27.       this.attributes = var1;
  28.    }
  29.  
  30.    public ReadOnlyAttributes(int var1) {
  31.       this.attributes = new Vector(var1);
  32.    }
  33.  
  34.    public int size() {
  35.       return this.attributes.size();
  36.    }
  37.  
  38.    public Attribute lookup(Name var1) {
  39.       Enumeration var2 = this.attributes.elements();
  40.  
  41.       while(var2.hasMoreElements()) {
  42.          Attribute var3 = (Attribute)var2.nextElement();
  43.          if (var3.name == var1) {
  44.             return var3;
  45.          }
  46.       }
  47.  
  48.       return null;
  49.    }
  50. }
  51.