]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/file/FileArrayAccessor.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / accessor / file / FileArrayAccessor.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.accessor.file;
13
14 import org.simantics.databoard.accessor.ArrayAccessor;
15 import org.simantics.databoard.accessor.ArrayAccessor.CloseableArrayAccessor;
16 import org.simantics.databoard.accessor.CloseableAccessor;
17 import org.simantics.databoard.accessor.error.AccessorException;
18 import org.simantics.databoard.binding.Binding;
19 import org.simantics.databoard.binding.error.BindingException;
20
21 public interface FileArrayAccessor extends ArrayAccessor, FileAccessor, CloseableAccessor, CloseableArrayAccessor {
22
23         /**
24          * Add a new value. 
25          * 
26          * @param binding
27          * @param value value
28          * @throws AccessorException
29          */
30         void addNoflush(Binding binding, Object value) throws AccessorException;
31
32         /**
33          * Add an array of elements.
34          * 
35          * @param binding
36          * @param values value 
37          * @throws AccessorException
38          */
39         void addAllNoflush(Binding binding, Object[] values) throws AccessorException;
40         
41         /**
42          * Add an array of elements.  
43          * 
44          * If elements are inserted in the middle of the array, existing interest sets
45          * are updated to reflect the new positions. 
46          * 
47          * @param index position to insert new value to
48          * @param binding
49          * @param values
50          * @throws AccessorException
51          */
52         void addAllNoflush(int index, Binding binding, Object[] values) throws AccessorException;
53         
54         /**
55          * Insert a new value.
56          * 
57          * If elements are inserted in the middle of the array, existing interest sets
58          * are updated to reflect the new positions. 
59          * 
60          * @param index position to insert new value to
61          * @param binding
62          * @param value value
63          * @throws AccessorException
64          */
65         void addNoflush(int index, Binding binding, Object value) throws AccessorException;
66         
67         /**
68          * Set all elements from an Array Value.
69          * 
70          * If array becomes shorter and there are accessors to the removed elements,
71          * the accessors are invalidated. 
72          * 
73          * @param binding
74          * @param newValue
75          * @throws BindingException binding error
76          * @throws UnsupportedOperationException cannot set a new value
77          */
78         void setValueNoflush(Binding binding, Object newValue) throws AccessorException;
79         
80         /**
81          * Replace a value container with a new value.
82          * 
83          * @param index
84          * @param binding
85          * @param value
86          * @throws AccessorException
87          */
88         void setNoflush(int index, Binding binding, Object value) throws AccessorException;
89         
90         /**
91          * Remove an element at an index.
92          *  
93          * If there are listeners to elements after the <code>null</code>, the 
94          * interest sets and accessor paths are updated and decreased.    
95          * 
96          * If there was an accessor, it becomes invalid.
97          * 
98          * @param index
99          * @param count
100          * @throws AccessorException
101          */
102         void removeNoflush(int index, int count) throws AccessorException;
103         
104         /**
105          * Set new array size
106          * 
107          * @param newSize
108          * @throws AccessorException
109          */
110         void setSizeNoflush(int newSize) throws AccessorException;      
111         
112 }
113