View Javadoc

1   package cz.cuni.amis.utils.flag;
2   
3   import java.io.Serializable;
4   
5   import cz.cuni.amis.utils.flag.Flag.DoInSync;
6   
7   /**
8    * Interface for flags. Flags is a reference that raises events each time the
9    * referenced object is changed.
10   * <p><p>
11   * Note that flag implementation must be {@link Serializable}!
12   * 
13   * @author ik
14   * @author Jimmy
15   */
16  public interface IFlag<T> extends Serializable {
17  
18      public void addListener(FlagListener<T> listener);
19  
20      public void addStrongListener(FlagListener<T> listener);
21  
22      public void clearListeners();
23  
24      public T getFlag();
25  
26      public boolean isListenning(FlagListener<T> listener);
27  
28      public void removeListener(FlagListener<T> listener);
29  
30      public void removeAllListeners();
31  
32      public void setFlag(T newValue);
33  
34      public ImmutableFlag<T> getImmutable();
35  
36      public void inSync(DoInSync<T> command);
37  
38      public boolean isFrozen();
39  
40      public void freeze();
41  
42      public void defreeze();
43  }