X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fadapter%2FGenericRelationIndex.java;h=c6041445acf1325918d55b74265aed5d598b0ac6;hp=7baf2456442d52f7ab9792842d86c372a56cd7ce;hb=HEAD;hpb=969bd23cab98a79ca9101af33334000879fb60c5 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/GenericRelationIndex.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/GenericRelationIndex.java index 7baf24564..c6041445a 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/GenericRelationIndex.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/GenericRelationIndex.java @@ -1,57 +1,57 @@ -/******************************************************************************* - * 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.adapter; - -import java.util.List; -import java.util.Map; - -import org.simantics.db.RequestProcessor; -import org.simantics.db.Resource; - -public interface GenericRelationIndex { - - /* - * Returns indexed results based on this relation with given constants that - * fulfill the specified search string. - */ - List> query(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount); - List queryResources(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount); - - /* - * Returns indexed results based on this relation with given constants. - * - * TODO: index listing is not useful like this for large indices. It needs - * support for listing the contents in a piecewise fashion, iterating - * through the complete index in slices. - */ - List> list(RequestProcessor session, String bindingPattern, Object[] constants, int maxResultCount); - - /* - * Starts to track changes in this relation. Updates an index using the - * IndexedRelations service. - */ - void trackAndIndex(RequestProcessor processor, Resource input); - void untrack(RequestProcessor processor, Resource input); - - /* - * Rebuilds this index - */ - void reset(RequestProcessor processor, Resource input); - - /* - * The observer is fired whenever changes to the relation are observed. This - * is applicable only after trackAndIndex has been called. - */ - void addListener(RequestProcessor processor, Resource model, Runnable observer); - void removeListener(RequestProcessor processor, Resource model, Runnable observer); - -} +/******************************************************************************* + * 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.adapter; + +import java.util.List; +import java.util.Map; + +import org.simantics.db.RequestProcessor; +import org.simantics.db.Resource; + +public interface GenericRelationIndex { + + /* + * Returns indexed results based on this relation with given constants that + * fulfill the specified search string. + */ + List> query(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount); + List queryResources(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount); + + /* + * Returns indexed results based on this relation with given constants. + * + * TODO: index listing is not useful like this for large indices. It needs + * support for listing the contents in a piecewise fashion, iterating + * through the complete index in slices. + */ + List> list(RequestProcessor session, String bindingPattern, Object[] constants, int maxResultCount); + + /* + * Starts to track changes in this relation. Updates an index using the + * IndexedRelations service. + */ + void trackAndIndex(RequestProcessor processor, Resource input); + void untrack(RequestProcessor processor, Resource input); + + /* + * Rebuilds this index + */ + void reset(RequestProcessor processor, Resource input); + + /* + * The observer is fired whenever changes to the relation are observed. This + * is applicable only after trackAndIndex has been called. + */ + void addListener(RequestProcessor processor, Resource model, Runnable observer); + void removeListener(RequestProcessor processor, Resource model, Runnable observer); + +}