home *** CD-ROM | disk | FTP | other *** search
- package java.util;
-
- import java.io.Serializable;
-
- class TreeMap$SubMap extends AbstractMap implements SortedMap, Serializable {
- private static final long serialVersionUID = -6520786458950516097L;
- private boolean fromStart;
- private boolean toEnd;
- private Object fromKey;
- private Object toKey;
- private transient Set entrySet;
- // $FF: synthetic field
- private final TreeMap this$0;
-
- TreeMap$SubMap(TreeMap var1, Object var2, Object var3) {
- this.this$0 = var1;
- this.fromStart = false;
- this.toEnd = false;
- this.entrySet = new TreeMap.SubMap.EntrySetView(this, (TreeMap.1)null);
- if (TreeMap.access$600(var1, var2, var3) > 0) {
- throw new IllegalArgumentException("fromKey > toKey");
- } else {
- this.fromKey = var2;
- this.toKey = var3;
- }
- }
-
- TreeMap$SubMap(TreeMap var1, Object var2, boolean var3) {
- this.this$0 = var1;
- this.fromStart = false;
- this.toEnd = false;
- this.entrySet = new TreeMap.SubMap.EntrySetView(this, (TreeMap.1)null);
- TreeMap.access$600(var1, var2, var2);
- if (var3) {
- this.fromStart = true;
- this.toKey = var2;
- } else {
- this.toEnd = true;
- this.fromKey = var2;
- }
-
- }
-
- TreeMap$SubMap(TreeMap var1, boolean var2, Object var3, boolean var4, Object var5) {
- this.this$0 = var1;
- this.fromStart = false;
- this.toEnd = false;
- this.entrySet = new TreeMap.SubMap.EntrySetView(this, (TreeMap.1)null);
- this.fromStart = var2;
- this.fromKey = var3;
- this.toEnd = var4;
- this.toKey = var5;
- }
-
- public boolean isEmpty() {
- return this.entrySet.isEmpty();
- }
-
- public boolean containsKey(Object var1) {
- return this.inRange(var1) && this.this$0.containsKey(var1);
- }
-
- public Object get(Object var1) {
- return !this.inRange(var1) ? null : this.this$0.get(var1);
- }
-
- public Object put(Object var1, Object var2) {
- if (!this.inRange(var1)) {
- throw new IllegalArgumentException("key out of range");
- } else {
- return this.this$0.put(var1, var2);
- }
- }
-
- public Comparator comparator() {
- return TreeMap.access$700(this.this$0);
- }
-
- public Object firstKey() {
- Object var1 = TreeMap.access$900(this.fromStart ? TreeMap.access$100(this.this$0) : TreeMap.access$800(this.this$0, this.fromKey));
- if (!this.toEnd && TreeMap.access$600(this.this$0, var1, this.toKey) >= 0) {
- throw new NoSuchElementException();
- } else {
- return var1;
- }
- }
-
- public Object lastKey() {
- Object var1 = TreeMap.access$900(this.toEnd ? TreeMap.access$1000(this.this$0) : TreeMap.access$1100(this.this$0, this.toKey));
- if (!this.fromStart && TreeMap.access$600(this.this$0, var1, this.fromKey) < 0) {
- throw new NoSuchElementException();
- } else {
- return var1;
- }
- }
-
- public Set entrySet() {
- return this.entrySet;
- }
-
- public SortedMap subMap(Object var1, Object var2) {
- if (!this.inRange2(var1)) {
- throw new IllegalArgumentException("fromKey out of range");
- } else if (!this.inRange2(var2)) {
- throw new IllegalArgumentException("toKey out of range");
- } else {
- return new TreeMap$SubMap(this.this$0, var1, var2);
- }
- }
-
- public SortedMap headMap(Object var1) {
- if (!this.inRange2(var1)) {
- throw new IllegalArgumentException("toKey out of range");
- } else {
- return new TreeMap$SubMap(this.this$0, this.fromStart, this.fromKey, false, var1);
- }
- }
-
- public SortedMap tailMap(Object var1) {
- if (!this.inRange2(var1)) {
- throw new IllegalArgumentException("fromKey out of range");
- } else {
- return new TreeMap$SubMap(this.this$0, false, var1, this.toEnd, this.toKey);
- }
- }
-
- private boolean inRange(Object var1) {
- 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);
- }
-
- private boolean inRange2(Object var1) {
- 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);
- }
-
- // $FF: synthetic method
- static TreeMap access$1300(TreeMap$SubMap var0) {
- return var0.this$0;
- }
-
- // $FF: synthetic method
- static boolean access$1500(TreeMap$SubMap var0, Object var1) {
- return var0.inRange(var1);
- }
-
- // $FF: synthetic method
- static boolean access$1600(TreeMap$SubMap var0) {
- return var0.fromStart;
- }
-
- // $FF: synthetic method
- static Object access$1700(TreeMap$SubMap var0) {
- return var0.fromKey;
- }
-
- // $FF: synthetic method
- static boolean access$1800(TreeMap$SubMap var0) {
- return var0.toEnd;
- }
-
- // $FF: synthetic method
- static Object access$1900(TreeMap$SubMap var0) {
- return var0.toKey;
- }
- }
-