home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / text / html / parser / Entity.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.4 KB  |  58 lines

  1. package javax.swing.text.html.parser;
  2.  
  3. import java.util.Hashtable;
  4.  
  5. public final class Entity implements DTDConstants {
  6.    public String name;
  7.    public int type;
  8.    public char[] data;
  9.    static Hashtable entityTypes = new Hashtable();
  10.  
  11.    public Entity(String var1, int var2, char[] var3) {
  12.       this.name = var1;
  13.       this.type = var2;
  14.       this.data = var3;
  15.    }
  16.  
  17.    public String getName() {
  18.       return this.name;
  19.    }
  20.  
  21.    public int getType() {
  22.       return this.type & '\uffff';
  23.    }
  24.  
  25.    public boolean isParameter() {
  26.       return (this.type & 262144) != 0;
  27.    }
  28.  
  29.    public boolean isGeneral() {
  30.       return (this.type & 65536) != 0;
  31.    }
  32.  
  33.    public char[] getData() {
  34.       return this.data;
  35.    }
  36.  
  37.    public String getString() {
  38.       return new String(this.data, 0, this.data.length);
  39.    }
  40.  
  41.    public static int name2type(String var0) {
  42.       Integer var1 = (Integer)entityTypes.get(var0);
  43.       return var1 == null ? 1 : var1;
  44.    }
  45.  
  46.    static {
  47.       entityTypes.put("PUBLIC", new Integer(10));
  48.       entityTypes.put("CDATA", new Integer(1));
  49.       entityTypes.put("SDATA", new Integer(11));
  50.       entityTypes.put("PI", new Integer(12));
  51.       entityTypes.put("STARTTAG", new Integer(13));
  52.       entityTypes.put("ENDTAG", new Integer(14));
  53.       entityTypes.put("MS", new Integer(15));
  54.       entityTypes.put("MD", new Integer(16));
  55.       entityTypes.put("SYSTEM", new Integer(17));
  56.    }
  57. }
  58.