]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/interestset/StringInterestSet.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / accessor / interestset / StringInterestSet.java
1 /*******************************************************************************
2  *  Copyright (c) 2010 Association for Decentralized Information Management in
3  *  Industry THTH ry.
4  *  All rights reserved. This program and the accompanying materials
5  *  are made available under the terms of the Eclipse Public License v1.0
6  *  which accompanies this distribution, and is available at
7  *  http://www.eclipse.org/legal/epl-v10.html
8  *
9  *  Contributors:
10  *      VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.databoard.accessor.interestset;
13
14 import org.simantics.databoard.type.StringType;
15
16 /**
17  * Interest set of a String Type. 
18  *
19  * @see StringType 
20  * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
21  */
22 public class StringInterestSet extends InterestSet {
23         
24         public static final StringInterestSet MONITOR_EVERYTHING = new StringInterestSet(true, true); 
25         
26         /** Interested in the notification (excludes the value) */
27         public boolean notification = true;
28         /** Interested in the value (includes notification) */  
29         public boolean value = true;
30         
31         public StringInterestSet(boolean notification, boolean value) {
32                 this.notification = notification;
33                 this.value = value;
34         }
35
36         /**
37          * Returns true, if interested in notifications or the value.  
38          * 
39          * Note, interest to notification alone does not imply interest in the value. 
40          * 
41          * @return true, if interested in notifications.
42          */
43         public boolean inNotifications() {
44                 return notification | value;
45         }
46         
47         /**
48          * Returns true, if interested in the value  
49          * 
50          * @return true, if interested in the value
51          */
52         public boolean inValues() {
53                 return value;
54         }
55         
56 }
57