View Javadoc

1   /*
2    *  jDTAUS Core API
3    *  Copyright (C) 2005 Christian Schulte
4    *  <cs@schulte.it>
5    *
6    *  This library is free software; you can redistribute it and/or
7    *  modify it under the terms of the GNU Lesser General Public
8    *  License as published by the Free Software Foundation; either
9    *  version 2.1 of the License, or any later version.
10   *
11   *  This library is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   *  Lesser General Public License for more details.
15   *
16   *  You should have received a copy of the GNU Lesser General Public
17   *  License along with this library; if not, write to the Free Software
18   *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19   *
20   */
21  package org.jdtaus.core.io;
22  
23  import java.io.IOException;
24  import java.util.EventListener;
25  
26  /**
27   * Listener for structural changes of {@code StructuredFile}s.
28   *
29   * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
30   * @version $JDTAUS: StructuredFileListener.java 8641 2012-09-27 06:45:17Z schulte $
31   */
32  public interface StructuredFileListener extends EventListener
33  {
34      //--StructuredFileListener--------------------------------------------------
35  
36      /**
37       * Gets called whenever blocks were inserted into the {@code StructuredFile}
38       * the listener is registered with. The block previously at {@code index}
39       * will have moved to {@code index + insertedBlocks}.
40       *
41       * @param index the index of the first inserted block.
42       * @param insertedBlocks the number of blocks which were inserted at
43       * {@code index}.
44       *
45       * @throws IOException if reading or writing fails.
46       */
47      void blocksInserted( long index, long insertedBlocks ) throws IOException;
48  
49      /**
50       * Gets called whenever blocks were deleted from the {@code StructuredFile}
51       * the listener is registered with. The block previously at
52       * {@code index + deletedBlocks} will have moved to {@code index}.
53       *
54       * @param index the index of the first deleted block.
55       * @param deletedBlocks the number of blocks which were deleted starting
56       * at {@code index} inclusive.
57       *
58       * @throws IOException if reading or writing fails.
59       */
60      void blocksDeleted( long index, long deletedBlocks ) throws IOException;
61  
62      //--------------------------------------------------StructuredFileListener--
63  }