-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.utils.datastructures;\r
-\r
-import java.util.Collection;\r
-import java.util.Iterator;\r
-\r
-public abstract class ImmutableCollection<T> implements Collection<T> {\r
-\r
- public boolean add(T e) {\r
- throw new UnsupportedOperationException();\r
- }\r
-\r
- public boolean addAll(Collection<? extends T> c) {\r
- throw new UnsupportedOperationException();\r
- }\r
-\r
- public void clear() {\r
- throw new UnsupportedOperationException();\r
- }\r
-\r
- public boolean remove(Object o) {\r
- throw new UnsupportedOperationException();\r
- }\r
-\r
- public boolean removeAll(Collection<?> c) {\r
- throw new UnsupportedOperationException();\r
- }\r
-\r
- public boolean retainAll(Collection<?> c) {\r
- throw new UnsupportedOperationException();\r
- }\r
-\r
- abstract public boolean contains(Object o);\r
- abstract public boolean containsAll(Collection<?> c);\r
- abstract public boolean isEmpty();\r
- abstract public Iterator<T> iterator(); \r
- abstract public int size();\r
- \r
- public Object[] toArray() {\r
- Object[] ret = new Object[size()];\r
- int i=0;\r
- for(T a : this) \r
- ret[i++] = a;\r
- return ret;\r
- }\r
-\r
- public <U> U[] toArray(U[] a) {\r
- // TODO\r
- throw new UnsupportedOperationException();\r
- }\r
- \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.utils.datastructures;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+public abstract class ImmutableCollection<T> implements Collection<T> {
+
+ public boolean add(T e) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean addAll(Collection<? extends T> c) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void clear() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean remove(Object o) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean removeAll(Collection<?> c) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean retainAll(Collection<?> c) {
+ throw new UnsupportedOperationException();
+ }
+
+ abstract public boolean contains(Object o);
+ abstract public boolean containsAll(Collection<?> c);
+ abstract public boolean isEmpty();
+ abstract public Iterator<T> iterator();
+ abstract public int size();
+
+ public Object[] toArray() {
+ Object[] ret = new Object[size()];
+ int i=0;
+ for(T a : this)
+ ret[i++] = a;
+ return ret;
+ }
+
+ public <U> U[] toArray(U[] a) {
+ // TODO
+ throw new UnsupportedOperationException();
+ }
+
+}