home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / util / ResourceBundle$CacheKey.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  3.4 KB  |  179 lines

  1. package java.util;
  2.  
  3. final class ResourceBundle$CacheKey implements Cloneable {
  4.    private String name;
  5.    private Locale locale;
  6.    private ResourceBundle.LoaderReference loaderRef;
  7.    private String format;
  8.    private volatile long loadTime;
  9.    private volatile long expirationTime;
  10.    private Throwable cause;
  11.    private int hashCodeCache;
  12.  
  13.    ResourceBundle$CacheKey(String var1, Locale var2, ClassLoader var3) {
  14.       this.name = var1;
  15.       this.locale = var2;
  16.       if (var3 == null) {
  17.          this.loaderRef = null;
  18.       } else {
  19.          this.loaderRef = new ResourceBundle.LoaderReference(var3, ResourceBundle.access$200(), this);
  20.       }
  21.  
  22.       this.calculateHashCode();
  23.    }
  24.  
  25.    String getName() {
  26.       return this.name;
  27.    }
  28.  
  29.    ResourceBundle$CacheKey setName(String var1) {
  30.       if (!this.name.equals(var1)) {
  31.          this.name = var1;
  32.          this.calculateHashCode();
  33.       }
  34.  
  35.       return this;
  36.    }
  37.  
  38.    Locale getLocale() {
  39.       return this.locale;
  40.    }
  41.  
  42.    ResourceBundle$CacheKey setLocale(Locale var1) {
  43.       if (!this.locale.equals(var1)) {
  44.          this.locale = var1;
  45.          this.calculateHashCode();
  46.       }
  47.  
  48.       return this;
  49.    }
  50.  
  51.    ClassLoader getLoader() {
  52.       return this.loaderRef != null ? (ClassLoader)this.loaderRef.get() : null;
  53.    }
  54.  
  55.    public boolean equals(Object var1) {
  56.       if (this == var1) {
  57.          return true;
  58.       } else {
  59.          try {
  60.             ResourceBundle$CacheKey var2 = (ResourceBundle$CacheKey)var1;
  61.             if (this.hashCodeCache != var2.hashCodeCache) {
  62.                return false;
  63.             }
  64.  
  65.             if (!this.name.equals(var2.name)) {
  66.                return false;
  67.             }
  68.  
  69.             if (!this.locale.equals(var2.locale)) {
  70.                return false;
  71.             }
  72.  
  73.             if (this.loaderRef == null) {
  74.                return var2.loaderRef == null;
  75.             }
  76.  
  77.             ClassLoader var3 = (ClassLoader)this.loaderRef.get();
  78.             return var2.loaderRef != null && var3 != null && var3 == var2.loaderRef.get();
  79.          } catch (NullPointerException var4) {
  80.          } catch (ClassCastException var5) {
  81.          }
  82.  
  83.          return false;
  84.       }
  85.    }
  86.  
  87.    public int hashCode() {
  88.       return this.hashCodeCache;
  89.    }
  90.  
  91.    private void calculateHashCode() {
  92.       this.hashCodeCache = this.name.hashCode() << 3;
  93.       this.hashCodeCache ^= this.locale.hashCode();
  94.       ClassLoader var1 = this.getLoader();
  95.       if (var1 != null) {
  96.          this.hashCodeCache ^= var1.hashCode();
  97.       }
  98.  
  99.    }
  100.  
  101.    public Object clone() {
  102.       try {
  103.          ResourceBundle$CacheKey var1 = (ResourceBundle$CacheKey)super.clone();
  104.          if (this.loaderRef != null) {
  105.             var1.loaderRef = new ResourceBundle.LoaderReference((ClassLoader)this.loaderRef.get(), ResourceBundle.access$200(), var1);
  106.          }
  107.  
  108.          var1.cause = null;
  109.          return var1;
  110.       } catch (CloneNotSupportedException var2) {
  111.          throw new InternalError();
  112.       }
  113.    }
  114.  
  115.    String getFormat() {
  116.       return this.format;
  117.    }
  118.  
  119.    void setFormat(String var1) {
  120.       this.format = var1;
  121.    }
  122.  
  123.    private void setCause(Throwable var1) {
  124.       if (this.cause == null) {
  125.          this.cause = var1;
  126.       } else if (this.cause instanceof ClassNotFoundException) {
  127.          this.cause = var1;
  128.       }
  129.  
  130.    }
  131.  
  132.    private Throwable getCause() {
  133.       return this.cause;
  134.    }
  135.  
  136.    public String toString() {
  137.       String var1 = this.locale.toString();
  138.       if (var1.length() == 0) {
  139.          if (this.locale.getVariant().length() != 0) {
  140.             var1 = "__" + this.locale.getVariant();
  141.          } else {
  142.             var1 = "\"\"";
  143.          }
  144.       }
  145.  
  146.       return "CacheKey[" + this.name + ", lc=" + var1 + ", ldr=" + this.getLoader() + "(format=" + this.format + ")]";
  147.    }
  148.  
  149.    // $FF: synthetic method
  150.    static Throwable access$400(ResourceBundle$CacheKey var0) {
  151.       return var0.getCause();
  152.    }
  153.  
  154.    // $FF: synthetic method
  155.    static void access$500(ResourceBundle$CacheKey var0, Throwable var1) {
  156.       var0.setCause(var1);
  157.    }
  158.  
  159.    // $FF: synthetic method
  160.    static long access$600(ResourceBundle$CacheKey var0) {
  161.       return var0.expirationTime;
  162.    }
  163.  
  164.    // $FF: synthetic method
  165.    static long access$700(ResourceBundle$CacheKey var0) {
  166.       return var0.loadTime;
  167.    }
  168.  
  169.    // $FF: synthetic method
  170.    static long access$702(ResourceBundle$CacheKey var0, long var1) {
  171.       return var0.loadTime = var1;
  172.    }
  173.  
  174.    // $FF: synthetic method
  175.    static long access$602(ResourceBundle$CacheKey var0, long var1) {
  176.       return var0.expirationTime = var1;
  177.    }
  178. }
  179.