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 / util / TreeMap$SubMap.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  3.5 KB  |  165 lines

  1. package java.util;
  2.  
  3. import java.io.Serializable;
  4.  
  5. class TreeMap$SubMap extends AbstractMap implements SortedMap, Serializable {
  6.    private static final long serialVersionUID = -6520786458950516097L;
  7.    private boolean fromStart;
  8.    private boolean toEnd;
  9.    private Object fromKey;
  10.    private Object toKey;
  11.    private transient Set entrySet;
  12.    // $FF: synthetic field
  13.    private final TreeMap this$0;
  14.  
  15.    TreeMap$SubMap(TreeMap var1, Object var2, Object var3) {
  16.       this.this$0 = var1;
  17.       this.fromStart = false;
  18.       this.toEnd = false;
  19.       this.entrySet = new TreeMap.SubMap.EntrySetView(this, (TreeMap.1)null);
  20.       if (TreeMap.access$600(var1, var2, var3) > 0) {
  21.          throw new IllegalArgumentException("fromKey > toKey");
  22.       } else {
  23.          this.fromKey = var2;
  24.          this.toKey = var3;
  25.       }
  26.    }
  27.  
  28.    TreeMap$SubMap(TreeMap var1, Object var2, boolean var3) {
  29.       this.this$0 = var1;
  30.       this.fromStart = false;
  31.       this.toEnd = false;
  32.       this.entrySet = new TreeMap.SubMap.EntrySetView(this, (TreeMap.1)null);
  33.       TreeMap.access$600(var1, var2, var2);
  34.       if (var3) {
  35.          this.fromStart = true;
  36.          this.toKey = var2;
  37.       } else {
  38.          this.toEnd = true;
  39.          this.fromKey = var2;
  40.       }
  41.  
  42.    }
  43.  
  44.    TreeMap$SubMap(TreeMap var1, boolean var2, Object var3, boolean var4, Object var5) {
  45.       this.this$0 = var1;
  46.       this.fromStart = false;
  47.       this.toEnd = false;
  48.       this.entrySet = new TreeMap.SubMap.EntrySetView(this, (TreeMap.1)null);
  49.       this.fromStart = var2;
  50.       this.fromKey = var3;
  51.       this.toEnd = var4;
  52.       this.toKey = var5;
  53.    }
  54.  
  55.    public boolean isEmpty() {
  56.       return this.entrySet.isEmpty();
  57.    }
  58.  
  59.    public boolean containsKey(Object var1) {
  60.       return this.inRange(var1) && this.this$0.containsKey(var1);
  61.    }
  62.  
  63.    public Object get(Object var1) {
  64.       return !this.inRange(var1) ? null : this.this$0.get(var1);
  65.    }
  66.  
  67.    public Object put(Object var1, Object var2) {
  68.       if (!this.inRange(var1)) {
  69.          throw new IllegalArgumentException("key out of range");
  70.       } else {
  71.          return this.this$0.put(var1, var2);
  72.       }
  73.    }
  74.  
  75.    public Comparator comparator() {
  76.       return TreeMap.access$700(this.this$0);
  77.    }
  78.  
  79.    public Object firstKey() {
  80.       Object var1 = TreeMap.access$900(this.fromStart ? TreeMap.access$100(this.this$0) : TreeMap.access$800(this.this$0, this.fromKey));
  81.       if (!this.toEnd && TreeMap.access$600(this.this$0, var1, this.toKey) >= 0) {
  82.          throw new NoSuchElementException();
  83.       } else {
  84.          return var1;
  85.       }
  86.    }
  87.  
  88.    public Object lastKey() {
  89.       Object var1 = TreeMap.access$900(this.toEnd ? TreeMap.access$1000(this.this$0) : TreeMap.access$1100(this.this$0, this.toKey));
  90.       if (!this.fromStart && TreeMap.access$600(this.this$0, var1, this.fromKey) < 0) {
  91.          throw new NoSuchElementException();
  92.       } else {
  93.          return var1;
  94.       }
  95.    }
  96.  
  97.    public Set entrySet() {
  98.       return this.entrySet;
  99.    }
  100.  
  101.    public SortedMap subMap(Object var1, Object var2) {
  102.       if (!this.inRange2(var1)) {
  103.          throw new IllegalArgumentException("fromKey out of range");
  104.       } else if (!this.inRange2(var2)) {
  105.          throw new IllegalArgumentException("toKey out of range");
  106.       } else {
  107.          return new TreeMap$SubMap(this.this$0, var1, var2);
  108.       }
  109.    }
  110.  
  111.    public SortedMap headMap(Object var1) {
  112.       if (!this.inRange2(var1)) {
  113.          throw new IllegalArgumentException("toKey out of range");
  114.       } else {
  115.          return new TreeMap$SubMap(this.this$0, this.fromStart, this.fromKey, false, var1);
  116.       }
  117.    }
  118.  
  119.    public SortedMap tailMap(Object var1) {
  120.       if (!this.inRange2(var1)) {
  121.          throw new IllegalArgumentException("fromKey out of range");
  122.       } else {
  123.          return new TreeMap$SubMap(this.this$0, false, var1, this.toEnd, this.toKey);
  124.       }
  125.    }
  126.  
  127.    private boolean inRange(Object var1) {
  128.       return (this.fromStart || TreeMap.access$600(this.this$0, var1, this.fromKey) >= 0) && (this.toEnd || TreeMap.access$600(this.this$0, var1, this.toKey) < 0);
  129.    }
  130.  
  131.    private boolean inRange2(Object var1) {
  132.       return (this.fromStart || TreeMap.access$600(this.this$0, var1, this.fromKey) >= 0) && (this.toEnd || TreeMap.access$600(this.this$0, var1, this.toKey) <= 0);
  133.    }
  134.  
  135.    // $FF: synthetic method
  136.    static TreeMap access$1300(TreeMap$SubMap var0) {
  137.       return var0.this$0;
  138.    }
  139.  
  140.    // $FF: synthetic method
  141.    static boolean access$1500(TreeMap$SubMap var0, Object var1) {
  142.       return var0.inRange(var1);
  143.    }
  144.  
  145.    // $FF: synthetic method
  146.    static boolean access$1600(TreeMap$SubMap var0) {
  147.       return var0.fromStart;
  148.    }
  149.  
  150.    // $FF: synthetic method
  151.    static Object access$1700(TreeMap$SubMap var0) {
  152.       return var0.fromKey;
  153.    }
  154.  
  155.    // $FF: synthetic method
  156.    static boolean access$1800(TreeMap$SubMap var0) {
  157.       return var0.toEnd;
  158.    }
  159.  
  160.    // $FF: synthetic method
  161.    static Object access$1900(TreeMap$SubMap var0) {
  162.       return var0.toKey;
  163.    }
  164. }
  165.