aboutsummaryrefslogtreecommitdiff
path: root/src/Java/binnie/craftgui/minecraft/ListMap.java
blob: 7c0fbf37dd4d631736b7e85a05928bc1c2af3d6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
package binnie.craftgui.minecraft;

import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map.Entry;
import java.util.Set;

class ListMap<T>
  implements List<T>
{
  private LinkedHashMap<Integer, T> map = new LinkedHashMap();
  
  public int size()
  {
    int i = -1;
    for (Iterator i$ = this.map.keySet().iterator(); i$.hasNext();)
    {
      int k = ((Integer)i$.next()).intValue();
      if (k > i) {
        i = k;
      }
    }
    return i + 1;
  }
  
  public boolean isEmpty()
  {
    return this.map.isEmpty();
  }
  
  public boolean contains(Object o)
  {
    return this.map.containsValue(o);
  }
  
  public Iterator<T> iterator()
  {
    return this.map.values().iterator();
  }
  
  public Object[] toArray()
  {
    return this.map.values().toArray();
  }
  
  public <P> P[] toArray(P[] a)
  {
    return this.map.values().toArray(a);
  }
  
  public boolean add(T e)
  {
    if (get(size()) == null)
    {
      add(size(), e);
      return true;
    }
    return false;
  }
  
  public boolean remove(Object o)
  {
    return false;
  }
  
  public boolean containsAll(Collection<?> c)
  {
    return this.map.values().containsAll(c);
  }
  
  public boolean addAll(Collection<? extends T> c)
  {
    return false;
  }
  
  public boolean addAll(int index, Collection<? extends T> c)
  {
    return false;
  }
  
  public boolean removeAll(Collection<?> c)
  {
    return false;
  }
  
  public boolean retainAll(Collection<?> c)
  {
    return false;
  }
  
  public void clear()
  {
    this.map.clear();
  }
  
  public T get(int index)
  {
    return this.map.get(Integer.valueOf(index));
  }
  
  public T set(int index, T element)
  {
    this.map.put(Integer.valueOf(index), element);
    return element;
  }
  
  public void add(int index, T element)
  {
    this.map.put(Integer.valueOf(index), element);
  }
  
  public T remove(int index)
  {
    return null;
  }
  
  public int indexOf(Object o)
  {
    for (Map.Entry<Integer, T> entry : this.map.entrySet()) {
      if (entry.getValue() == o) {
        return ((Integer)entry.getKey()).intValue();
      }
    }
    return 0;
  }
  
  public int lastIndexOf(Object o)
  {
    return indexOf(o);
  }
  
  public ListIterator<T> listIterator()
  {
    return null;
  }
  
  public ListIterator<T> listIterator(int index)
  {
    return null;
  }
  
  public List<T> subList(int fromIndex, int toIndex)
  {
    return null;
  }
}