]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/file/FileArrayAccessor.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / accessor / file / FileArrayAccessor.java
diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/file/FileArrayAccessor.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/file/FileArrayAccessor.java
new file mode 100644 (file)
index 0000000..d3d9df5
--- /dev/null
@@ -0,0 +1,113 @@
+/*******************************************************************************\r
+ *  Copyright (c) 2010 Association for Decentralized Information Management in\r
+ *  Industry THTH ry.\r
+ *  All rights reserved. This program and the accompanying materials\r
+ *  are made available under the terms of the Eclipse Public License v1.0\r
+ *  which accompanies this distribution, and is available at\r
+ *  http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ *  Contributors:\r
+ *      VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.databoard.accessor.file;
+
+import org.simantics.databoard.accessor.ArrayAccessor;\r
+import org.simantics.databoard.accessor.ArrayAccessor.CloseableArrayAccessor;\r
+import org.simantics.databoard.accessor.CloseableAccessor;\r
+import org.simantics.databoard.accessor.error.AccessorException;\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.binding.error.BindingException;\r
+
+public interface FileArrayAccessor extends ArrayAccessor, FileAccessor, CloseableAccessor, CloseableArrayAccessor {
+
+       /**
+        * Add a new value. 
+        * 
+        * @param binding
+        * @param value value
+        * @throws AccessorException
+        */
+       void addNoflush(Binding binding, Object value) throws AccessorException;
+
+       /**
+        * Add an array of elements.
+        * 
+        * @param binding
+        * @param values value 
+        * @throws AccessorException
+        */
+       void addAllNoflush(Binding binding, Object[] values) throws AccessorException;
+       
+       /**
+        * Add an array of elements.  
+        * 
+        * If elements are inserted in the middle of the array, existing interest sets
+        * are updated to reflect the new positions. 
+        * 
+        * @param index position to insert new value to
+        * @param binding
+        * @param values
+        * @throws AccessorException
+        */
+       void addAllNoflush(int index, Binding binding, Object[] values) throws AccessorException;
+       
+       /**
+        * Insert a new value.
+        * 
+        * If elements are inserted in the middle of the array, existing interest sets
+        * are updated to reflect the new positions. 
+        * 
+        * @param index position to insert new value to
+        * @param binding
+        * @param value value
+        * @throws AccessorException
+        */
+       void addNoflush(int index, Binding binding, Object value) throws AccessorException;
+       
+       /**
+        * Set all elements from an Array Value.
+        * 
+        * If array becomes shorter and there are accessors to the removed elements,
+        * the accessors are invalidated. 
+        * 
+        * @param binding
+        * @param newValue
+        * @throws BindingException binding error
+        * @throws UnsupportedOperationException cannot set a new value
+        */
+       void setValueNoflush(Binding binding, Object newValue) throws AccessorException;
+       
+       /**
+        * Replace a value container with a new value.
+        * 
+        * @param index
+        * @param binding
+        * @param value
+        * @throws AccessorException
+        */
+       void setNoflush(int index, Binding binding, Object value) throws AccessorException;
+       
+       /**
+        * Remove an element at an index.
+        *  
+        * If there are listeners to elements after the <code>null</code>, the 
+        * interest sets and accessor paths are updated and decreased.    
+        * 
+        * If there was an accessor, it becomes invalid.
+        * 
+        * @param index
+        * @param count
+        * @throws AccessorException
+        */
+       void removeNoflush(int index, int count) throws AccessorException;
+       \r
+       /**\r
+        * Set new array size\r
+        * \r
+        * @param newSize\r
+        * @throws AccessorException\r
+        */\r
+       void setSizeNoflush(int newSize) throws AccessorException;      \r
+       
+}
+