home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / java / lang / reflect / Field.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.5 KB  |  108 lines

  1. package java.lang.reflect;
  2.  
  3. public final class Field extends AccessibleObject implements Member {
  4.    private Class clazz;
  5.    private int slot;
  6.    private String name;
  7.    private Class type;
  8.    private int modifiers;
  9.  
  10.    private Field() {
  11.    }
  12.  
  13.    public Class getDeclaringClass() {
  14.       return this.clazz;
  15.    }
  16.  
  17.    public String getName() {
  18.       return this.name;
  19.    }
  20.  
  21.    public int getModifiers() {
  22.       return this.modifiers;
  23.    }
  24.  
  25.    public Class getType() {
  26.       return this.type;
  27.    }
  28.  
  29.    public boolean equals(Object var1) {
  30.       if (var1 != null && var1 instanceof Field) {
  31.          Field var2 = (Field)var1;
  32.          return this.getDeclaringClass() == var2.getDeclaringClass() && this.getName().equals(var2.getName()) && this.getType() == var2.getType();
  33.       } else {
  34.          return false;
  35.       }
  36.    }
  37.  
  38.    public int hashCode() {
  39.       return this.getDeclaringClass().getName().hashCode() ^ this.getName().hashCode();
  40.    }
  41.  
  42.    public String toString() {
  43.       int var1 = this.getModifiers();
  44.       return (var1 == 0 ? "" : Modifier.toString(var1) + " ") + getTypeName(this.getType()) + " " + getTypeName(this.getDeclaringClass()) + "." + this.getName();
  45.    }
  46.  
  47.    public native Object get(Object var1) throws IllegalArgumentException, IllegalAccessException;
  48.  
  49.    public native boolean getBoolean(Object var1) throws IllegalArgumentException, IllegalAccessException;
  50.  
  51.    public native byte getByte(Object var1) throws IllegalArgumentException, IllegalAccessException;
  52.  
  53.    public native char getChar(Object var1) throws IllegalArgumentException, IllegalAccessException;
  54.  
  55.    public native short getShort(Object var1) throws IllegalArgumentException, IllegalAccessException;
  56.  
  57.    public native int getInt(Object var1) throws IllegalArgumentException, IllegalAccessException;
  58.  
  59.    public native long getLong(Object var1) throws IllegalArgumentException, IllegalAccessException;
  60.  
  61.    public native float getFloat(Object var1) throws IllegalArgumentException, IllegalAccessException;
  62.  
  63.    public native double getDouble(Object var1) throws IllegalArgumentException, IllegalAccessException;
  64.  
  65.    public native void set(Object var1, Object var2) throws IllegalArgumentException, IllegalAccessException;
  66.  
  67.    public native void setBoolean(Object var1, boolean var2) throws IllegalArgumentException, IllegalAccessException;
  68.  
  69.    public native void setByte(Object var1, byte var2) throws IllegalArgumentException, IllegalAccessException;
  70.  
  71.    public native void setChar(Object var1, char var2) throws IllegalArgumentException, IllegalAccessException;
  72.  
  73.    public native void setShort(Object var1, short var2) throws IllegalArgumentException, IllegalAccessException;
  74.  
  75.    public native void setInt(Object var1, int var2) throws IllegalArgumentException, IllegalAccessException;
  76.  
  77.    public native void setLong(Object var1, long var2) throws IllegalArgumentException, IllegalAccessException;
  78.  
  79.    public native void setFloat(Object var1, float var2) throws IllegalArgumentException, IllegalAccessException;
  80.  
  81.    public native void setDouble(Object var1, double var2) throws IllegalArgumentException, IllegalAccessException;
  82.  
  83.    static String getTypeName(Class var0) {
  84.       if (var0.isArray()) {
  85.          try {
  86.             Class var1 = var0;
  87.  
  88.             int var2;
  89.             for(var2 = 0; var1.isArray(); var1 = var1.getComponentType()) {
  90.                ++var2;
  91.             }
  92.  
  93.             StringBuffer var3 = new StringBuffer();
  94.             var3.append(var1.getName());
  95.  
  96.             for(int var4 = 0; var4 < var2; ++var4) {
  97.                var3.append("[]");
  98.             }
  99.  
  100.             return var3.toString();
  101.          } catch (Throwable var5) {
  102.          }
  103.       }
  104.  
  105.       return var0.getName();
  106.    }
  107. }
  108.