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 / java / beans / FeatureDescriptor.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.0 KB  |  126 lines

  1. package java.beans;
  2.  
  3. import java.util.Enumeration;
  4. import java.util.Hashtable;
  5.  
  6. public class FeatureDescriptor {
  7.    private boolean expert;
  8.    private boolean hidden;
  9.    private boolean preferred;
  10.    private String shortDescription;
  11.    private String name;
  12.    private String displayName;
  13.    private Hashtable table;
  14.  
  15.    public FeatureDescriptor() {
  16.    }
  17.  
  18.    public String getName() {
  19.       return this.name;
  20.    }
  21.  
  22.    public void setName(String var1) {
  23.       this.name = var1;
  24.    }
  25.  
  26.    public String getDisplayName() {
  27.       return this.displayName == null ? this.getName() : this.displayName;
  28.    }
  29.  
  30.    public void setDisplayName(String var1) {
  31.       this.displayName = var1;
  32.    }
  33.  
  34.    public boolean isExpert() {
  35.       return this.expert;
  36.    }
  37.  
  38.    public void setExpert(boolean var1) {
  39.       this.expert = var1;
  40.    }
  41.  
  42.    public boolean isHidden() {
  43.       return this.hidden;
  44.    }
  45.  
  46.    public void setHidden(boolean var1) {
  47.       this.hidden = var1;
  48.    }
  49.  
  50.    public boolean isPreferred() {
  51.       return this.preferred;
  52.    }
  53.  
  54.    public void setPreferred(boolean var1) {
  55.       this.preferred = var1;
  56.    }
  57.  
  58.    public String getShortDescription() {
  59.       return this.shortDescription == null ? this.getDisplayName() : this.shortDescription;
  60.    }
  61.  
  62.    public void setShortDescription(String var1) {
  63.       this.shortDescription = var1;
  64.    }
  65.  
  66.    public void setValue(String var1, Object var2) {
  67.       if (this.table == null) {
  68.          this.table = new Hashtable();
  69.       }
  70.  
  71.       this.table.put(var1, var2);
  72.    }
  73.  
  74.    public Object getValue(String var1) {
  75.       return this.table == null ? null : this.table.get(var1);
  76.    }
  77.  
  78.    public Enumeration attributeNames() {
  79.       if (this.table == null) {
  80.          this.table = new Hashtable();
  81.       }
  82.  
  83.       return this.table.keys();
  84.    }
  85.  
  86.    FeatureDescriptor(FeatureDescriptor var1, FeatureDescriptor var2) {
  87.       this.expert = var1.expert | var2.expert;
  88.       this.hidden = var1.hidden | var2.hidden;
  89.       this.name = var2.name;
  90.       this.shortDescription = var1.shortDescription;
  91.       if (var2.shortDescription != null) {
  92.          this.shortDescription = var2.shortDescription;
  93.       }
  94.  
  95.       this.displayName = var1.displayName;
  96.       if (var2.displayName != null) {
  97.          this.displayName = var2.displayName;
  98.       }
  99.  
  100.       this.addTable(var1.table);
  101.       this.addTable(var2.table);
  102.    }
  103.  
  104.    FeatureDescriptor(FeatureDescriptor var1) {
  105.       this.expert = var1.expert;
  106.       this.hidden = var1.hidden;
  107.       this.name = var1.name;
  108.       this.shortDescription = var1.shortDescription;
  109.       this.displayName = var1.displayName;
  110.       this.addTable(var1.table);
  111.    }
  112.  
  113.    private void addTable(Hashtable var1) {
  114.       if (var1 != null) {
  115.          Enumeration var2 = var1.keys();
  116.  
  117.          while(var2.hasMoreElements()) {
  118.             String var3 = (String)var2.nextElement();
  119.             Object var4 = var1.get(var3);
  120.             this.setValue(var3, var4);
  121.          }
  122.  
  123.       }
  124.    }
  125. }
  126.