1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.utils.datastructures;
\r
14 import java.util.Collection;
\r
15 import java.util.Iterator;
\r
17 public abstract class ImmutableCollection<T> implements Collection<T> {
\r
19 public boolean add(T e) {
\r
20 throw new UnsupportedOperationException();
\r
23 public boolean addAll(Collection<? extends T> c) {
\r
24 throw new UnsupportedOperationException();
\r
27 public void clear() {
\r
28 throw new UnsupportedOperationException();
\r
31 public boolean remove(Object o) {
\r
32 throw new UnsupportedOperationException();
\r
35 public boolean removeAll(Collection<?> c) {
\r
36 throw new UnsupportedOperationException();
\r
39 public boolean retainAll(Collection<?> c) {
\r
40 throw new UnsupportedOperationException();
\r
43 abstract public boolean contains(Object o);
\r
44 abstract public boolean containsAll(Collection<?> c);
\r
45 abstract public boolean isEmpty();
\r
46 abstract public Iterator<T> iterator();
\r
47 abstract public int size();
\r
49 public Object[] toArray() {
\r
50 Object[] ret = new Object[size()];
\r
57 public <U> U[] toArray(U[] a) {
\r
59 throw new UnsupportedOperationException();
\r