X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scenegraph%2Fsrc%2Forg%2Fsimantics%2Fscenegraph%2FILookupService.java;h=25c1663b5875ae6ea45e5533d5d24d33582d7201;hb=e8b96542ea305825ae4dbf7c35f11275689ef564;hp=55548682fe26809fbcfc618fd8d2f63b3dacd90d;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/ILookupService.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/ILookupService.java index 55548682f..25c1663b5 100644 --- a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/ILookupService.java +++ b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/ILookupService.java @@ -1,68 +1,68 @@ -/******************************************************************************* - * 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.scenegraph; - -/** - * A bijective mapping service between unique String ID's and scene graph nodes - * ({@link INode}). - * - * @author Tuukka Lehtonen - */ -public interface ILookupService { - - /** - * Associates the specified node with the specified ID. If the specified ID - * is already associated the previous association will be overwritten with - * the new one and the previously associated node is returned. - * - * @param id the id to map to the specified node - * @param node node to map to specified id - * @return the node previously associated with the specified ID or - * null if the specified ID no previous association - * @throws NullPointerException if either argument is null - */ - INode map(String id, INode node); - - /** - * Removes possibly existing ID <=> node mapping from the lookup service. - * - * @param id the id to unmap - * @return the unmapped INode if successful, null otherwise - */ - INode unmap(String id); - - /** - * Removes possibly existing node <=> ID mapping from the lookup service. - * - * @param node the node to unmap - * @return the unmapped ID if successful, null otherwise - */ - String unmap(INode node); - - /** - * Get the node mapped to the specified ID. - * - * @param id identifier of the node to look for - * @return node mapped with specified id or null if no mapping - * exists - */ - INode lookupNode(String id); - - /** - * Get the mapping ID for the specified node. - * - * @param node node to get mapping ID for - * @return mapping ID of the node or null if node is not mapped - */ - String lookupId(INode node); - -} +/******************************************************************************* + * 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.scenegraph; + +/** + * A bijective mapping service between unique String ID's and scene graph nodes + * ({@link INode}). + * + * @author Tuukka Lehtonen + */ +public interface ILookupService { + + /** + * Associates the specified node with the specified ID. If the specified ID + * is already associated the previous association will be overwritten with + * the new one and the previously associated node is returned. + * + * @param id the id to map to the specified node + * @param node node to map to specified id + * @return the node previously associated with the specified ID or + * null if the specified ID no previous association + * @throws NullPointerException if either argument is null + */ + INode map(String id, INode node); + + /** + * Removes possibly existing ID <=> node mapping from the lookup service. + * + * @param id the id to unmap + * @return the unmapped INode if successful, null otherwise + */ + INode unmap(String id); + + /** + * Removes possibly existing node <=> ID mapping from the lookup service. + * + * @param node the node to unmap + * @return the unmapped ID if successful, null otherwise + */ + String unmap(INode node); + + /** + * Get the node mapped to the specified ID. + * + * @param id identifier of the node to look for + * @return node mapped with specified id or null if no mapping + * exists + */ + INode lookupNode(String id); + + /** + * Get the mapping ID for the specified node. + * + * @param node node to get mapping ID for + * @return mapping ID of the node or null if node is not mapped + */ + String lookupId(INode node); + +}