]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/interestset/IntegerInterestSet.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / accessor / interestset / IntegerInterestSet.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.IntegerType;
15
16 /**
17  * Interest set of Integer Type.
18  *
19  * @see IntegerType
20  * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
21  */
22 public class IntegerInterestSet extends InterestSet {
23         
24         public static final IntegerInterestSet MONITOR_EVERYTHING = new IntegerInterestSet(true, true); 
25         
26         /** Interested in notification (excludes the value) */
27         public boolean notification = true;
28         /** Interested in the value (includes notification) */  
29         public boolean value = true;
30         
31         public IntegerInterestSet(boolean notification, boolean value) {
32                 this.notification = notification;
33                 this.value = value;
34         }
35
36         /**
37          * Returns true, if interested in notification. This does not include
38          * interest in the value.
39          * 
40          * @return true if interested in notifications 
41          */
42         public boolean inNotifications() {
43                 return notification | value;
44         }
45         
46         /**
47          * Returns true, if interested in notification and the new value   
48          * 
49          * @return true if interested in the value
50          */
51         public boolean inValues() {
52                 return value;
53         }
54         
55 }
56