X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fgraph%2FArraySet.java;h=1360cef74eed4f747b8e610c5aef0d72fae04450;hb=195c63dd5c7600170f594750de96793ebf06a0ad;hp=d7e0aa8bc979a00bb229f30ec2b56eded6337dd3;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ArraySet.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ArraySet.java index d7e0aa8bc..1360cef74 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ArraySet.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ArraySet.java @@ -1,130 +1,130 @@ -/******************************************************************************* - * 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.db.impl.graph; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; - -import org.simantics.db.Resource; -import org.simantics.db.impl.query.IntSet; -import org.simantics.db.impl.query.QuerySupport; - -public class ArraySet implements Set { - - final Resource[] set; - - ArraySet(IntSet intSet, QuerySupport support) { - - if(intSet.data == null) { - if(intSet.sizeOrData != IntSet.NO_DATA) { - set = new Resource[] { support.getResource(intSet.sizeOrData) }; - } else { - set = Resource.NONE; - } - } else { - set = new Resource[intSet.sizeOrData]; - for(int i=0;i c) { - throw new UnsupportedOperationException(); - } - - @Override - public void clear() { - throw new UnsupportedOperationException(); - } - - @Override - public boolean contains(Object o) { - for(int i=0;i c) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isEmpty() { - return set.length == 0; - } - - @Override - public Iterator iterator() { - - class ArraySetIterator implements Iterator { - - int next = 0; - - @Override - public boolean hasNext() { - return next < set.length; - } - - @Override - public Resource next() { - return set[next++]; - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - } - - return new ArraySetIterator(); - - } - - @Override - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - @Override - public int size() { - return set.length; - } - - @Override - public Object[] toArray() { - throw new UnsupportedOperationException(); - } - - @Override - public T[] toArray(T[] a) { - 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.db.impl.graph; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Set; + +import org.simantics.db.Resource; +import org.simantics.db.impl.query.IntSet; +import org.simantics.db.impl.query.QuerySupport; + +public class ArraySet implements Set { + + final Resource[] set; + + ArraySet(IntSet intSet, QuerySupport support) { + + if(intSet.data == null) { + if(intSet.sizeOrData != IntSet.NO_DATA) { + set = new Resource[] { support.getResource(intSet.sizeOrData) }; + } else { + set = Resource.NONE; + } + } else { + set = new Resource[intSet.sizeOrData]; + for(int i=0;i c) { + throw new UnsupportedOperationException(); + } + + @Override + public void clear() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean contains(Object o) { + for(int i=0;i c) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isEmpty() { + return set.length == 0; + } + + @Override + public Iterator iterator() { + + class ArraySetIterator implements Iterator { + + int next = 0; + + @Override + public boolean hasNext() { + return next < set.length; + } + + @Override + public Resource next() { + return set[next++]; + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + } + + return new ArraySetIterator(); + + } + + @Override + public boolean remove(Object o) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean removeAll(Collection c) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean retainAll(Collection c) { + throw new UnsupportedOperationException(); + } + + @Override + public int size() { + return set.length; + } + + @Override + public Object[] toArray() { + throw new UnsupportedOperationException(); + } + + @Override + public T[] toArray(T[] a) { + throw new UnsupportedOperationException(); + } + +}