X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.utils.datastructures%2Fsrc%2Forg%2Fsimantics%2Futils%2Fdatastructures%2FImmutableCollection.java;h=5caa7786f58f1d5a418a123ba2ba95a7afb47a41;hp=06a3970033915b0b962a8fdaaac2bfdf82398a92;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.utils.datastructures/src/org/simantics/utils/datastructures/ImmutableCollection.java b/bundles/org.simantics.utils.datastructures/src/org/simantics/utils/datastructures/ImmutableCollection.java index 06a397003..5caa7786f 100644 --- a/bundles/org.simantics.utils.datastructures/src/org/simantics/utils/datastructures/ImmutableCollection.java +++ b/bundles/org.simantics.utils.datastructures/src/org/simantics/utils/datastructures/ImmutableCollection.java @@ -1,62 +1,62 @@ -/******************************************************************************* - * 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 implements Collection { - - public boolean add(T e) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(Collection 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 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[] toArray(U[] a) { - // TODO - throw new UnsupportedOperationException(); - } - -} +/******************************************************************************* + * 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 implements Collection { + + public boolean add(T e) { + throw new UnsupportedOperationException(); + } + + public boolean addAll(Collection 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 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[] toArray(U[] a) { + // TODO + throw new UnsupportedOperationException(); + } + +}