]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/file/IFileList.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / file / IFileList.java
1 /*******************************************************************************\r
2  *  Copyright (c) 2010 Association for Decentralized Information Management in\r
3  *  Industry THTH ry.\r
4  *  All rights reserved. This program and the accompanying materials\r
5  *  are made available under the terms of the Eclipse Public License v1.0\r
6  *  which accompanies this distribution, and is available at\r
7  *  http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  *  Contributors:\r
10  *      VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.databoard.file;
13
14 import java.io.File;\r
15 import java.io.IOException;\r
16 import java.util.List;\r
17 \r
18 import org.simantics.databoard.binding.Binding;\r
19
20 /**
21  * ListFile a {@link List} view to a random access file.
22  * <p>
23  * Note! 
24  *   - {@link IOException}s are wrapped around {@link RuntimeIOException}.
25  *   - The use of this class is not multi-thread safe.
26  * 
27  * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
28  */
29 public interface IFileList<T> extends List<T> {
30                 
31         /**
32          * Get the mapped file
33          * 
34          * @return file
35          */
36         File getFile();
37         
38         /**
39          * Get class-data type binding  
40          * 
41          * @return the binding
42          */
43         Binding getBinding();
44         
45     /**
46      * Removes from this list all of the elements whose index is between
47      * <code>fromIndex</code>, inclusive, and <code>toIndex</code>, exclusive.
48      * Shifts any succeeding elements to the left (reduces their index).  This
49      * call shortens the List by <code>(toIndex - fromIndex)</code> elements.  
50      * (If <code>toIndex==fromIndex</code>, this operation has no effect.)<p>
51      *
52      * @param fromIndex the index of the first element to removed.
53      * @param toIndex index after last element to be removed (exculsive).
54      * 
55      * @throws UnsupportedOperationException if the <code>remove</code> method is
56      *            not supported by this list.
57      * @throws IndexOutOfBoundsException if the index is out of range (index
58      *            &lt; 0 || index + count &gt;= size()).
59      */
60         void removeRange(int fromIndex, int toIndex);
61
62     /**
63      * Close the file
64      */
65     void close()
66     throws IOException;
67     
68 }
69