samples/openfixed/src/org/apidesign/openfixed/ModificationEvent.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 03 Apr 2020 16:32:36 +0200
changeset 416 9ed8788a1a4e
parent 373 c20d1d8ef2ca
permissions -rw-r--r--
Using HTTPS to download the libraries
     1 package org.apidesign.openfixed;
     2 
     3 import java.util.Collection;
     4 import java.util.EventObject;
     5 
     6 // BEGIN: openfixed.event
     7 public final class ModificationEvent extends EventObject {
     8     private final int delta;
     9     ModificationEvent(Object source, int delta) {
    10         super(source);
    11         this.delta = delta;
    12     }
    13     
    14     public int getChange() {
    15         return delta;
    16     }
    17     
    18 // FINISH: openfixed.event
    19     
    20 // BEGIN: openfixed.addgetter    
    21     int pending;
    22     /** @since 2.0 */
    23     public int getPending() {
    24         return pending;
    25     }
    26 // END: openfixed.addgetter    
    27     
    28 // BEGIN: openfixed.mount
    29     Collection<PostModificationListener> posts;
    30     /** @since 3.0 */
    31     public void postProcess(PostModificationListener p) {
    32         posts.add(p);
    33     }
    34 // END: openfixed.mount  
    35 }