1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
14 * @author Toni Kalajainen
\r
16 package org.simantics.utils.datastructures.hints;
\r
20 * IHintStack is a layered stack of hint contexts.
\r
21 * Each hint context has a priority.
\r
22 * Hint set in higher priority context overrides all lower priority hints of
\r
25 * Hint set in a hint context does not become effective if there
\r
26 * exists another hint of the same key in a higher priority context.
\r
28 * If the higher priority context or its hint is removed, the next lower level hint
\r
29 * becomes effective.
\r
31 * getHint() method is global. It returns the highest priority value for the key.
\r
32 * It does not return the hint set for a specific context, instead it returns the hint
\r
33 * set in the highest priority context.
\r
35 public interface IHintStack extends IHintObservable {
\r
37 void addHintContext(IHintContext hints, int priority);
\r
39 boolean removeHintContext(IHintContext hints);
\r
42 * Returns a wrapper hint context whose read operations originate from the stack, and
\r
43 * write operations to the a local stack (argument ctx)
\r
45 * @param ctx the hint context to write into
\r
46 * @return write-localized hint context based on this hint stack
\r
48 IHintContext createStackRead(final IHintContext ctx);
\r