]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.utils.datastructures/src/org/simantics/utils/datastructures/hints/IHintObservable.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.utils.datastructures / src / org / simantics / utils / datastructures / hints / IHintObservable.java
index 9d31c1c6365b5b114d7ed5b51ac24ac86f42e9ee..9eb4e827c97ff074c6bd9b640629d748aa9eb8f9 100644 (file)
-/*******************************************************************************\r
- * Copyright (c) 2007, 2015 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *     Semantum Oy - added getHintsUnsafe\r
- *******************************************************************************/\r
-/*\r
- *\r
- * @author Toni Kalajainen\r
- */\r
-package org.simantics.utils.datastructures.hints;\r
-\r
-import java.util.Map;\r
-\r
-import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
-import org.simantics.utils.threads.IThreadWorkQueue;\r
-\r
-\r
-public interface IHintObservable {\r
-\r
-    /**\r
-     * Check if this observable contains a value for the specified hint key.\r
-     * \r
-     * @param key the key to check for a value \r
-     * @return <code>true</code> if there is a value, <code>false</code> otherwise\r
-     */\r
-    boolean containsHint(Key key);\r
-\r
-       /**\r
-        * Get hint\r
-     * @param <E> type of the object bound to the specified key\r
-        * @param key key\r
-        * @return the hint or <code>null</code> if does not exist\r
-        */\r
-       <E> E getHint(Key key);\r
-       \r
-       /**\r
-        * Get all hints in this context\r
-        * @return a snapshot of all the hints in this context\r
-        */\r
-       Map<Key, Object> getHints();\r
-       \r
-       /**\r
-        * Get all hints in this context without creating defensive copies in the\r
-        * implementation if possible.\r
-        * <p>\r
-        * Use this only when reading and you know what you're doing.\r
-        * \r
-        * @return the backing map of hints in this context without extra copying if possible\r
-        */\r
-       Map<Key, Object> getHintsUnsafe();\r
-       \r
-       /**\r
-        * Get all hints whose key is a subclass of <code>clazz</code>\r
-        * @param <E> \r
-        * @param clazz the class\r
-        * @return key object map\r
-        */\r
-       <E extends Key> Map<E, Object> getHintsOfClass(Class<E> clazz);\r
-       \r
-       /**\r
-        * Adds hint listener, which gets events for all hint changes\r
-        * \r
-        * @param listener\r
-        */\r
-       void addHintListener(IHintListener listener);\r
-       \r
-       /**\r
-        * Removes hint listener\r
-        * \r
-        * @param listener\r
-        */\r
-       void removeHintListener(IHintListener listener);\r
-       \r
-       /**\r
-        * Adds hint listener for a specific key\r
-        * @param key\r
-        * @param listener\r
-        */\r
-       void addKeyHintListener(Key key, IHintListener listener);\r
-       \r
-       /**\r
-        * Removes hint listener\r
-        * @param key\r
-        * @param listener\r
-        */\r
-       void removeKeyHintListener(Key key, IHintListener listener);\r
-       \r
-       /**\r
-        * Adds hint listener, which gets events for all hint changes\r
-        * \r
-     * @param threadAccess \r
-        * @param listener\r
-        */\r
-       void addHintListener(IThreadWorkQueue threadAccess, IHintListener listener);\r
-       \r
-       /**\r
-        * Removes hint listener\r
-        * \r
-     * @param threadAccess \r
-        * @param listener\r
-        */\r
-       void removeHintListener(IThreadWorkQueue threadAccess, IHintListener listener);\r
-       \r
-       /**\r
-        * Adds hint listener for a specific key\r
-        * @param threadAccess \r
-        * @param key\r
-        * @param listener\r
-        */\r
-       void addKeyHintListener(IThreadWorkQueue threadAccess, Key key, IHintListener listener);\r
-       \r
-       /**\r
-        * Removes hint listener\r
-     * @param threadAccess \r
-        * @param key\r
-        * @param listener\r
-        */\r
-       void removeKeyHintListener(IThreadWorkQueue threadAccess, Key key, IHintListener listener);     \r
-       \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2015 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
+ *     Semantum Oy - added getHintsUnsafe
+ *******************************************************************************/
+/*
+ *
+ * @author Toni Kalajainen
+ */
+package org.simantics.utils.datastructures.hints;
+
+import java.util.Map;
+
+import org.simantics.utils.datastructures.hints.IHintContext.Key;
+import org.simantics.utils.threads.IThreadWorkQueue;
+
+
+public interface IHintObservable {
+
+    /**
+     * Check if this observable contains a value for the specified hint key.
+     * 
+     * @param key the key to check for a value 
+     * @return <code>true</code> if there is a value, <code>false</code> otherwise
+     */
+    boolean containsHint(Key key);
+
+       /**
+        * Get hint
+     * @param <E> type of the object bound to the specified key
+        * @param key key
+        * @return the hint or <code>null</code> if does not exist
+        */
+       <E> E getHint(Key key);
+       
+       /**
+        * Get all hints in this context
+        * @return a snapshot of all the hints in this context
+        */
+       Map<Key, Object> getHints();
+       
+       /**
+        * Get all hints in this context without creating defensive copies in the
+        * implementation if possible.
+        * <p>
+        * Use this only when reading and you know what you're doing.
+        * 
+        * @return the backing map of hints in this context without extra copying if possible
+        */
+       Map<Key, Object> getHintsUnsafe();
+       
+       /**
+        * Get all hints whose key is a subclass of <code>clazz</code>
+        * @param <E> 
+        * @param clazz the class
+        * @return key object map
+        */
+       <E extends Key> Map<E, Object> getHintsOfClass(Class<E> clazz);
+       
+       /**
+        * Adds hint listener, which gets events for all hint changes
+        * 
+        * @param listener
+        */
+       void addHintListener(IHintListener listener);
+       
+       /**
+        * Removes hint listener
+        * 
+        * @param listener
+        */
+       void removeHintListener(IHintListener listener);
+       
+       /**
+        * Adds hint listener for a specific key
+        * @param key
+        * @param listener
+        */
+       void addKeyHintListener(Key key, IHintListener listener);
+       
+       /**
+        * Removes hint listener
+        * @param key
+        * @param listener
+        */
+       void removeKeyHintListener(Key key, IHintListener listener);
+       
+       /**
+        * Adds hint listener, which gets events for all hint changes
+        * 
+     * @param threadAccess 
+        * @param listener
+        */
+       void addHintListener(IThreadWorkQueue threadAccess, IHintListener listener);
+       
+       /**
+        * Removes hint listener
+        * 
+     * @param threadAccess 
+        * @param listener
+        */
+       void removeHintListener(IThreadWorkQueue threadAccess, IHintListener listener);
+       
+       /**
+        * Adds hint listener for a specific key
+        * @param threadAccess 
+        * @param key
+        * @param listener
+        */
+       void addKeyHintListener(IThreadWorkQueue threadAccess, Key key, IHintListener listener);
+       
+       /**
+        * Removes hint listener
+     * @param threadAccess 
+        * @param key
+        * @param listener
+        */
+       void removeKeyHintListener(IThreadWorkQueue threadAccess, Key key, IHintListener listener);     
+       
+}