/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/android/support/v4/f/h.java

https://github.com/HelloHuDi/AndroidReverseNotes · Java · 499 lines · 420 code · 79 blank · 0 comment · 61 complexity · d279b3dc9767acd85f894f5de8105404 MD5 · raw file

  1. package android.support.v4.f;
  2. import java.lang.reflect.Array;
  3. import java.util.Collection;
  4. import java.util.Iterator;
  5. import java.util.Map;
  6. import java.util.Map.Entry;
  7. import java.util.NoSuchElementException;
  8. import java.util.Set;
  9. public abstract class h<K, V> {
  10. b Lm;
  11. c Ln;
  12. e Lo;
  13. final class a<T> implements Iterator<T> {
  14. final int Lp;
  15. boolean Lq = false;
  16. int mIndex;
  17. int mSize;
  18. a(int i) {
  19. this.Lp = i;
  20. this.mSize = h.this.eh();
  21. }
  22. public final boolean hasNext() {
  23. return this.mIndex < this.mSize;
  24. }
  25. public final T next() {
  26. if (hasNext()) {
  27. Object v = h.this.v(this.mIndex, this.Lp);
  28. this.mIndex++;
  29. this.Lq = true;
  30. return v;
  31. }
  32. throw new NoSuchElementException();
  33. }
  34. public final void remove() {
  35. if (this.Lq) {
  36. this.mIndex--;
  37. this.mSize--;
  38. this.Lq = false;
  39. h.this.aC(this.mIndex);
  40. return;
  41. }
  42. throw new IllegalStateException();
  43. }
  44. }
  45. final class b implements Set<Entry<K, V>> {
  46. b() {
  47. }
  48. public final boolean addAll(Collection<? extends Entry<K, V>> collection) {
  49. int eh = h.this.eh();
  50. for (Entry entry : collection) {
  51. h.this.d(entry.getKey(), entry.getValue());
  52. }
  53. return eh != h.this.eh();
  54. }
  55. public final void clear() {
  56. h.this.ej();
  57. }
  58. public final boolean contains(Object obj) {
  59. if (!(obj instanceof Entry)) {
  60. return false;
  61. }
  62. Entry entry = (Entry) obj;
  63. int E = h.this.E(entry.getKey());
  64. if (E >= 0) {
  65. return c.equal(h.this.v(E, 1), entry.getValue());
  66. }
  67. return false;
  68. }
  69. public final boolean containsAll(Collection<?> collection) {
  70. for (Object contains : collection) {
  71. if (!contains(contains)) {
  72. return false;
  73. }
  74. }
  75. return true;
  76. }
  77. public final boolean isEmpty() {
  78. return h.this.eh() == 0;
  79. }
  80. public final Iterator<Entry<K, V>> iterator() {
  81. return new d();
  82. }
  83. public final boolean remove(Object obj) {
  84. throw new UnsupportedOperationException();
  85. }
  86. public final boolean removeAll(Collection<?> collection) {
  87. throw new UnsupportedOperationException();
  88. }
  89. public final boolean retainAll(Collection<?> collection) {
  90. throw new UnsupportedOperationException();
  91. }
  92. public final int size() {
  93. return h.this.eh();
  94. }
  95. public final Object[] toArray() {
  96. throw new UnsupportedOperationException();
  97. }
  98. public final <T> T[] toArray(T[] tArr) {
  99. throw new UnsupportedOperationException();
  100. }
  101. public final boolean equals(Object obj) {
  102. return h.a((Set) this, obj);
  103. }
  104. public final int hashCode() {
  105. int eh = h.this.eh() - 1;
  106. int i = 0;
  107. while (eh >= 0) {
  108. int i2;
  109. Object v = h.this.v(eh, 0);
  110. Object v2 = h.this.v(eh, 1);
  111. int hashCode = v == null ? 0 : v.hashCode();
  112. if (v2 == null) {
  113. i2 = 0;
  114. } else {
  115. i2 = v2.hashCode();
  116. }
  117. eh--;
  118. i += i2 ^ hashCode;
  119. }
  120. return i;
  121. }
  122. public final /* synthetic */ boolean add(Object obj) {
  123. throw new UnsupportedOperationException();
  124. }
  125. }
  126. final class c implements Set<K> {
  127. c() {
  128. }
  129. public final boolean add(K k) {
  130. throw new UnsupportedOperationException();
  131. }
  132. public final boolean addAll(Collection<? extends K> collection) {
  133. throw new UnsupportedOperationException();
  134. }
  135. public final void clear() {
  136. h.this.ej();
  137. }
  138. public final boolean contains(Object obj) {
  139. return h.this.E(obj) >= 0;
  140. }
  141. public final boolean containsAll(Collection<?> collection) {
  142. Map ei = h.this.ei();
  143. for (Object containsKey : collection) {
  144. if (!ei.containsKey(containsKey)) {
  145. return false;
  146. }
  147. }
  148. return true;
  149. }
  150. public final boolean isEmpty() {
  151. return h.this.eh() == 0;
  152. }
  153. public final Iterator<K> iterator() {
  154. return new a(0);
  155. }
  156. public final boolean remove(Object obj) {
  157. int E = h.this.E(obj);
  158. if (E < 0) {
  159. return false;
  160. }
  161. h.this.aC(E);
  162. return true;
  163. }
  164. public final boolean removeAll(Collection<?> collection) {
  165. Map ei = h.this.ei();
  166. int size = ei.size();
  167. for (Object remove : collection) {
  168. ei.remove(remove);
  169. }
  170. return size != ei.size();
  171. }
  172. public final boolean retainAll(Collection<?> collection) {
  173. return h.a(h.this.ei(), (Collection) collection);
  174. }
  175. public final int size() {
  176. return h.this.eh();
  177. }
  178. public final Object[] toArray() {
  179. return h.this.aG(0);
  180. }
  181. public final <T> T[] toArray(T[] tArr) {
  182. return h.this.c(tArr, 0);
  183. }
  184. public final boolean equals(Object obj) {
  185. return h.a((Set) this, obj);
  186. }
  187. public final int hashCode() {
  188. int i = 0;
  189. for (int eh = h.this.eh() - 1; eh >= 0; eh--) {
  190. Object v = h.this.v(eh, 0);
  191. i += v == null ? 0 : v.hashCode();
  192. }
  193. return i;
  194. }
  195. }
  196. final class d implements Iterator<Entry<K, V>>, Entry<K, V> {
  197. int Ls;
  198. boolean Lt = false;
  199. int mIndex;
  200. d() {
  201. this.Ls = h.this.eh() - 1;
  202. this.mIndex = -1;
  203. }
  204. public final boolean hasNext() {
  205. return this.mIndex < this.Ls;
  206. }
  207. public final void remove() {
  208. if (this.Lt) {
  209. h.this.aC(this.mIndex);
  210. this.mIndex--;
  211. this.Ls--;
  212. this.Lt = false;
  213. return;
  214. }
  215. throw new IllegalStateException();
  216. }
  217. public final K getKey() {
  218. if (this.Lt) {
  219. return h.this.v(this.mIndex, 0);
  220. }
  221. throw new IllegalStateException("This container does not support retaining Map.Entry objects");
  222. }
  223. public final V getValue() {
  224. if (this.Lt) {
  225. return h.this.v(this.mIndex, 1);
  226. }
  227. throw new IllegalStateException("This container does not support retaining Map.Entry objects");
  228. }
  229. public final V setValue(V v) {
  230. if (this.Lt) {
  231. return h.this.a(this.mIndex, (Object) v);
  232. }
  233. throw new IllegalStateException("This container does not support retaining Map.Entry objects");
  234. }
  235. public final boolean equals(Object obj) {
  236. if (!this.Lt) {
  237. throw new IllegalStateException("This container does not support retaining Map.Entry objects");
  238. } else if (!(obj instanceof Entry)) {
  239. return false;
  240. } else {
  241. Entry entry = (Entry) obj;
  242. if (c.equal(entry.getKey(), h.this.v(this.mIndex, 0)) && c.equal(entry.getValue(), h.this.v(this.mIndex, 1))) {
  243. return true;
  244. }
  245. return false;
  246. }
  247. }
  248. public final int hashCode() {
  249. int i = 0;
  250. if (this.Lt) {
  251. Object v = h.this.v(this.mIndex, 0);
  252. Object v2 = h.this.v(this.mIndex, 1);
  253. int hashCode = v == null ? 0 : v.hashCode();
  254. if (v2 != null) {
  255. i = v2.hashCode();
  256. }
  257. return i ^ hashCode;
  258. }
  259. throw new IllegalStateException("This container does not support retaining Map.Entry objects");
  260. }
  261. public final String toString() {
  262. return getKey() + "=" + getValue();
  263. }
  264. public final /* synthetic */ Object next() {
  265. if (hasNext()) {
  266. this.mIndex++;
  267. this.Lt = true;
  268. return this;
  269. }
  270. throw new NoSuchElementException();
  271. }
  272. }
  273. final class e implements Collection<V> {
  274. e() {
  275. }
  276. public final boolean add(V v) {
  277. throw new UnsupportedOperationException();
  278. }
  279. public final boolean addAll(Collection<? extends V> collection) {
  280. throw new UnsupportedOperationException();
  281. }
  282. public final void clear() {
  283. h.this.ej();
  284. }
  285. public final boolean contains(Object obj) {
  286. return h.this.F(obj) >= 0;
  287. }
  288. public final boolean containsAll(Collection<?> collection) {
  289. for (Object contains : collection) {
  290. if (!contains(contains)) {
  291. return false;
  292. }
  293. }
  294. return true;
  295. }
  296. public final boolean isEmpty() {
  297. return h.this.eh() == 0;
  298. }
  299. public final Iterator<V> iterator() {
  300. return new a(1);
  301. }
  302. public final boolean remove(Object obj) {
  303. int F = h.this.F(obj);
  304. if (F < 0) {
  305. return false;
  306. }
  307. h.this.aC(F);
  308. return true;
  309. }
  310. public final boolean removeAll(Collection<?> collection) {
  311. int eh = h.this.eh();
  312. int i = 0;
  313. boolean z = false;
  314. while (i < eh) {
  315. if (collection.contains(h.this.v(i, 1))) {
  316. h.this.aC(i);
  317. i--;
  318. eh--;
  319. z = true;
  320. }
  321. i++;
  322. }
  323. return z;
  324. }
  325. public final boolean retainAll(Collection<?> collection) {
  326. int eh = h.this.eh();
  327. int i = 0;
  328. boolean z = false;
  329. while (i < eh) {
  330. if (!collection.contains(h.this.v(i, 1))) {
  331. h.this.aC(i);
  332. i--;
  333. eh--;
  334. z = true;
  335. }
  336. i++;
  337. }
  338. return z;
  339. }
  340. public final int size() {
  341. return h.this.eh();
  342. }
  343. public final Object[] toArray() {
  344. return h.this.aG(1);
  345. }
  346. public final <T> T[] toArray(T[] tArr) {
  347. return h.this.c(tArr, 1);
  348. }
  349. }
  350. public abstract int E(Object obj);
  351. public abstract int F(Object obj);
  352. public abstract V a(int i, V v);
  353. public abstract void aC(int i);
  354. public abstract void d(K k, V v);
  355. public abstract int eh();
  356. public abstract Map<K, V> ei();
  357. public abstract void ej();
  358. public abstract Object v(int i, int i2);
  359. h() {
  360. }
  361. public static <K, V> boolean a(Map<K, V> map, Collection<?> collection) {
  362. int size = map.size();
  363. Iterator it = map.keySet().iterator();
  364. while (it.hasNext()) {
  365. if (!collection.contains(it.next())) {
  366. it.remove();
  367. }
  368. }
  369. return size != map.size();
  370. }
  371. public final Object[] aG(int i) {
  372. int eh = eh();
  373. Object[] objArr = new Object[eh];
  374. for (int i2 = 0; i2 < eh; i2++) {
  375. objArr[i2] = v(i2, i);
  376. }
  377. return objArr;
  378. }
  379. public final <T> T[] c(T[] tArr, int i) {
  380. T[] tArr2;
  381. int eh = eh();
  382. if (tArr.length < eh) {
  383. tArr2 = (Object[]) Array.newInstance(tArr.getClass().getComponentType(), eh);
  384. } else {
  385. tArr2 = tArr;
  386. }
  387. for (int i2 = 0; i2 < eh; i2++) {
  388. tArr2[i2] = v(i2, i);
  389. }
  390. if (tArr2.length > eh) {
  391. tArr2[eh] = null;
  392. }
  393. return tArr2;
  394. }
  395. public static <T> boolean a(Set<T> set, Object obj) {
  396. if (set == obj) {
  397. return true;
  398. }
  399. if (!(obj instanceof Set)) {
  400. return false;
  401. }
  402. Set set2 = (Set) obj;
  403. try {
  404. if (set.size() == set2.size() && set.containsAll(set2)) {
  405. return true;
  406. }
  407. return false;
  408. } catch (NullPointerException e) {
  409. return false;
  410. } catch (ClassCastException e2) {
  411. return false;
  412. }
  413. }
  414. public final Set<K> getKeySet() {
  415. if (this.Ln == null) {
  416. this.Ln = new c();
  417. }
  418. return this.Ln;
  419. }
  420. }