X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Frequest%2FNextOrderedSetElement.java;h=b954bf331316c8edf010cf993c265108bab0827a;hb=33b30297f751e06e9abac260d31313e2f833fedc;hp=0c5afcf092b3620c3d5ee7b75b7bb4bc7cd41267;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/NextOrderedSetElement.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/NextOrderedSetElement.java index 0c5afcf09..b954bf331 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/NextOrderedSetElement.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/NextOrderedSetElement.java @@ -1,47 +1,47 @@ -/******************************************************************************* - * 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.layer0.request; - -import org.simantics.db.AsyncReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.common.request.ResourceAsyncRead2; -import org.simantics.db.procedure.AsyncProcedure; - -public class NextOrderedSetElement extends ResourceAsyncRead2 { - - public NextOrderedSetElement(Resource list, Resource element) { - super(list, element); - } - - @Override - public void perform(AsyncReadGraph graph, final AsyncProcedure procedure) { - - // resource = the list - // resource2 = the element - - graph.forPossibleObject(resource2, resource, new AsyncProcedure() { - - @Override - public void exception(AsyncReadGraph graph, Throwable t) { - procedure.exception(graph, t); - } - - @Override - public void execute(AsyncReadGraph graph, Resource next) { - if(resource.equals(next)) procedure.execute(graph, null); - else procedure.execute(graph, next); - } - }); - - } - +/******************************************************************************* + * 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.layer0.request; + +import org.simantics.db.AsyncReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.request.ResourceAsyncRead2; +import org.simantics.db.procedure.AsyncProcedure; + +public class NextOrderedSetElement extends ResourceAsyncRead2 { + + public NextOrderedSetElement(Resource list, Resource element) { + super(list, element); + } + + @Override + public void perform(AsyncReadGraph graph, final AsyncProcedure procedure) { + + // resource = the list + // resource2 = the element + + graph.forPossibleObject(resource2, resource, new AsyncProcedure() { + + @Override + public void exception(AsyncReadGraph graph, Throwable t) { + procedure.exception(graph, t); + } + + @Override + public void execute(AsyncReadGraph graph, Resource next) { + if(resource.equals(next)) procedure.execute(graph, null); + else procedure.execute(graph, next); + } + }); + + } + } \ No newline at end of file