Пример #1
0
 @SuppressWarnings("unchecked")
 @Override
 public <T> T[] toArray(T[] a) {
   // TODO: Optimize this to only allocate a new array if the set size
   // is larger than the array.length. If the set size is smaller than
   // the array.length then copy the data into the array and set the
   // last element in the array to be null.
   final T[] resizedArray =
       (T[])
           Array.newInstance(
               a.getClass().getComponentType(), complete(asyncSet.getAsImmutableSet()).size());
   return complete(asyncSet.getAsImmutableSet()).toArray(resizedArray);
 }
Пример #2
0
 @SuppressWarnings("unchecked")
 @Override
 public boolean remove(Object o) {
   return complete(asyncSet.remove((E) o));
 }
Пример #3
0
 @Override
 public boolean add(E e) {
   return complete(asyncSet.add(e));
 }
Пример #4
0
 @Override
 public Object[] toArray() {
   return complete(asyncSet.getAsImmutableSet()).stream().toArray();
 }
Пример #5
0
 @SuppressWarnings("unchecked")
 @Override
 public boolean contains(Object o) {
   return complete(asyncSet.contains((E) o));
 }
Пример #6
0
 @Override
 public Iterator<E> iterator() {
   return complete(asyncSet.getAsImmutableSet()).iterator();
 }
Пример #7
0
 @Override
 public int size() {
   return complete(asyncSet.size());
 }
Пример #8
0
 @Override
 public boolean isEmpty() {
   return complete(asyncSet.isEmpty());
 }
Пример #9
0
 @Override
 public void removeListener(SetEventListener<E> listener) {
   complete(asyncSet.removeListener(listener));
 }
Пример #10
0
 @Override
 public void addListener(SetEventListener<E> listener) {
   complete(asyncSet.addListener(listener));
 }
Пример #11
0
 @Override
 public void clear() {
   complete(asyncSet.clear());
 }
Пример #12
0
 @SuppressWarnings("unchecked")
 @Override
 public boolean removeAll(Collection<?> c) {
   return complete(asyncSet.removeAll((Collection<? extends E>) c));
 }
Пример #13
0
 @Override
 public boolean addAll(Collection<? extends E> c) {
   return complete(asyncSet.addAll(c));
 }