1 package org.sat4j.core;
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 import java.util.Comparator;
33 import java.util.Iterator;
34
35 import org.sat4j.specs.IVec;
36
37
38
39
40
41
42
43
44
45 public final class ReadOnlyVec<T> implements IVec<T> {
46
47
48
49
50 private static final long serialVersionUID = 1L;
51
52 private final IVec<T> vec;
53
54 public ReadOnlyVec(IVec<T> vec) {
55 this.vec = vec;
56 }
57
58 public void clear() {
59 throw new UnsupportedOperationException();
60 }
61
62 public void copyTo(IVec<T> copy) {
63 this.vec.copyTo(copy);
64 }
65
66 public <E> void copyTo(E[] dest) {
67 this.vec.copyTo(dest);
68 }
69
70 public T delete(int i) {
71 throw new UnsupportedOperationException();
72 }
73
74 public void ensure(int nsize) {
75 throw new UnsupportedOperationException();
76
77 }
78
79 public T get(int i) {
80 return this.vec.get(i);
81 }
82
83 public void growTo(int newsize, T pad) {
84 throw new UnsupportedOperationException();
85 }
86
87 public void insertFirst(T elem) {
88 throw new UnsupportedOperationException();
89 }
90
91 public void insertFirstWithShifting(T elem) {
92 throw new UnsupportedOperationException();
93 }
94
95 public boolean isEmpty() {
96 return this.vec.isEmpty();
97 }
98
99 public Iterator<T> iterator() {
100 return this.vec.iterator();
101 }
102
103 public T last() {
104 return this.vec.last();
105 }
106
107 public void moveTo(IVec<T> dest) {
108 throw new UnsupportedOperationException();
109 }
110
111 public void moveTo(int dest, int source) {
112 throw new UnsupportedOperationException();
113 }
114
115 public void pop() {
116 throw new UnsupportedOperationException();
117 }
118
119 public IVec<T> push(T elem) {
120 throw new UnsupportedOperationException();
121 }
122
123 public void remove(T elem) {
124 throw new UnsupportedOperationException();
125 }
126
127 public void set(int i, T o) {
128 throw new UnsupportedOperationException();
129 }
130
131 public void shrink(int nofelems) {
132 throw new UnsupportedOperationException();
133 }
134
135 public void shrinkTo(int newsize) {
136 throw new UnsupportedOperationException();
137 }
138
139 public int size() {
140 return this.vec.size();
141 }
142
143 public void sort(Comparator<T> comparator) {
144 throw new UnsupportedOperationException();
145 }
146
147 public void sortUnique(Comparator<T> comparator) {
148 throw new UnsupportedOperationException();
149 }
150
151 @SuppressWarnings("unchecked")
152 public T[] toArray() {
153 T[] array = (T[]) new Object[this.vec.size()];
154 this.vec.copyTo(array);
155 return array;
156 }
157
158 public void unsafePush(T elem) {
159 throw new UnsupportedOperationException();
160 }
161
162
163
164
165 public boolean contains(T element) {
166 return this.vec.contains(element);
167 }
168
169
170
171
172 public int indexOf(T element) {
173 return this.vec.indexOf(element);
174 }
175
176 @Override
177 public String toString() {
178 return this.vec.toString();
179 }
180
181 @Override
182 public int hashCode() {
183 return this.vec.hashCode();
184 }
185
186 @Override
187 public boolean equals(Object obj) {
188 return this.vec.equals(obj);
189 }
190
191 }