KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > common > notify > impl > NotifierImpl


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: NotifierImpl.java,v 1.2 2005/06/08 06:19:08 nickb Exp $
16  */

17 package org.eclipse.emf.common.notify.impl;
18
19
20 import org.eclipse.emf.common.util.BasicEList;
21 import org.eclipse.emf.common.util.EList;
22
23 /**
24  * An extensible notifier implementation.
25  */

26 public class NotifierImpl extends BasicNotifierImpl
27 {
28   /**
29    * The bit of {@link #eFlags} that is used to represent {@link #eDeliver}.
30    */

31   protected static final int EDELIVER = 0x0001;
32
33   /**
34    * The last bit used by this class; derived classes may use bit values higher than this.
35    */

36   protected static final int ELAST_NOTIFIER_FLAG = EDELIVER;
37
38   /**
39    * An extensible set of bit flags;
40    * the first bit is used for {@link #EDELIVER} to implement {@link #eDeliver}.
41    */

42   protected int eFlags = EDELIVER;
43
44   /**
45    * The list of {@link org.eclipse.emf.common.notify.Adapter}s associated with the notifier.
46    */

47   protected BasicEList eAdapters;
48
49   /**
50    * Creates a blank new instance.
51    */

52   public NotifierImpl()
53   {
54   }
55
56   /*
57    * Javadoc copied from interface.
58    */

59   public EList eAdapters()
60   {
61     if (eAdapters == null)
62     {
63       eAdapters = new EAdapterList(this);
64     }
65     return eAdapters;
66   }
67
68   protected BasicEList eBasicAdapters()
69   {
70     return eAdapters;
71   }
72
73   /*
74    * Javadoc copied from interface.
75    */

76   public boolean eDeliver()
77   {
78     return (eFlags & EDELIVER) != 0;
79   }
80
81   /*
82    * Javadoc copied from interface.
83    */

84   public void eSetDeliver(boolean deliver)
85   {
86     if (deliver)
87     {
88       this.eFlags |= EDELIVER;
89     }
90     else
91     {
92       this.eFlags &= ~EDELIVER;
93     }
94   }
95 }
96
Popular Tags