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 / Collections$SingletonMap.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.8 KB  |  64 lines

  1. package java.util;
  2.  
  3. import java.io.Serializable;
  4.  
  5. class Collections$SingletonMap<K, V> extends AbstractMap<K, V> implements Serializable {
  6.    private static final long serialVersionUID = -6979724477215052911L;
  7.    // $FF: renamed from: k java.lang.Object
  8.    private final K field_0;
  9.    // $FF: renamed from: v java.lang.Object
  10.    private final V field_1;
  11.    private transient Set<K> keySet = null;
  12.    private transient Set<Map.Entry<K, V>> entrySet = null;
  13.    private transient Collection<V> values = null;
  14.  
  15.    Collections$SingletonMap(K var1, V var2) {
  16.       this.field_0 = var1;
  17.       this.field_1 = var2;
  18.    }
  19.  
  20.    public int size() {
  21.       return 1;
  22.    }
  23.  
  24.    public boolean isEmpty() {
  25.       return false;
  26.    }
  27.  
  28.    public boolean containsKey(Object var1) {
  29.       return Collections.access$000(var1, this.field_0);
  30.    }
  31.  
  32.    public boolean containsValue(Object var1) {
  33.       return Collections.access$000(var1, this.field_1);
  34.    }
  35.  
  36.    public V get(Object var1) {
  37.       return (V)(Collections.access$000(var1, this.field_0) ? this.field_1 : null);
  38.    }
  39.  
  40.    public Set<K> keySet() {
  41.       if (this.keySet == null) {
  42.          this.keySet = Collections.singleton(this.field_0);
  43.       }
  44.  
  45.       return this.keySet;
  46.    }
  47.  
  48.    public Set<Map.Entry<K, V>> entrySet() {
  49.       if (this.entrySet == null) {
  50.          this.entrySet = Collections.singleton(new AbstractMap.SimpleImmutableEntry(this.field_0, this.field_1));
  51.       }
  52.  
  53.       return this.entrySet;
  54.    }
  55.  
  56.    public Collection<V> values() {
  57.       if (this.values == null) {
  58.          this.values = Collections.singleton(this.field_1);
  59.       }
  60.  
  61.       return this.values;
  62.    }
  63. }
  64.