]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/file/IFileList.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / file / IFileList.java
1 /*******************************************************************************
2  *  Copyright (c) 2010 Association for Decentralized Information Management in
3  *  Industry THTH ry.
4  *  All rights reserved. This program and the accompanying materials
5  *  are made available under the terms of the Eclipse Public License v1.0
6  *  which accompanies this distribution, and is available at
7  *  http://www.eclipse.org/legal/epl-v10.html
8  *
9  *  Contributors:
10  *      VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.databoard.file;
13
14 import java.io.File;
15 import java.io.IOException;
16 import java.util.List;
17
18 import org.simantics.databoard.binding.Binding;
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