1 package com.github.davidmoten.rx.internal.operators;
2
3 import java.util.Collection;
4 import java.util.Iterator;
5
6 abstract class AbstractQueueWithResources<T> implements QueueWithResources<T> {
7
8 private final QueueWithResources<T> q;
9
10 AbstractQueueWithResources(QueueWithResources<T> q) {
11 this.q = q;
12 }
13
14 @Override
15 public boolean add(T e) {
16 return q.add(e);
17 }
18
19 @Override
20 public boolean offer(T e) {
21 return q.offer(e);
22 }
23
24 @Override
25 public int size() {
26 return q.size();
27 }
28
29 @Override
30 public boolean isEmpty() {
31 return q.isEmpty();
32 }
33
34 @Override
35 public boolean contains(Object o) {
36 return q.contains(o);
37 }
38
39 @Override
40 public T remove() {
41 return q.remove();
42 }
43
44 @Override
45 public T poll() {
46 return q.poll();
47 }
48
49 @Override
50 public T element() {
51 return q.element();
52 }
53
54 @Override
55 public Iterator<T> iterator() {
56 return q.iterator();
57 }
58
59 @Override
60 public T peek() {
61 return q.peek();
62 }
63
64 @Override
65 public Object[] toArray() {
66 return q.toArray();
67 }
68
69 @Override
70 @SuppressWarnings("hiding")
71 public <T> T[] toArray(T[] a) {
72 return q.toArray(a);
73 }
74
75 @Override
76 public boolean remove(Object o) {
77 return q.remove(o);
78 }
79
80 @Override
81 public boolean containsAll(Collection<?> c) {
82 return q.containsAll(c);
83 }
84
85 @Override
86 public boolean addAll(Collection<? extends T> c) {
87 return q.addAll(c);
88 }
89
90 @Override
91 public boolean removeAll(Collection<?> c) {
92 return q.removeAll(c);
93 }
94
95 @Override
96 public boolean retainAll(Collection<?> c) {
97 return q.retainAll(c);
98 }
99
100 @Override
101 public void clear() {
102 q.clear();
103 }
104
105 @Override
106 public boolean equals(Object o) {
107 return q.equals(o);
108 }
109
110 @Override
111 public int hashCode() {
112 return q.hashCode();
113 }
114
115 @Override
116 public void unsubscribe() {
117 q.unsubscribe();
118 }
119
120 @Override
121 public void freeResources() {
122 q.freeResources();
123 }
124
125 @Override
126 public long resourcesSize() {
127 return q.resourcesSize();
128 }
129 }