X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Ffile%2FIFileList.java;fp=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Ffile%2FIFileList.java;h=95041720c1a285aa6f58ddc9f86a555b97958eb1;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/file/IFileList.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/file/IFileList.java new file mode 100644 index 000000000..95041720c --- /dev/null +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/file/IFileList.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright (c) 2010 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.databoard.file; + +import java.io.File; +import java.io.IOException; +import java.util.List; + +import org.simantics.databoard.binding.Binding; + +/** + * ListFile a {@link List} view to a random access file. + *

+ * Note! + * - {@link IOException}s are wrapped around {@link RuntimeIOException}. + * - The use of this class is not multi-thread safe. + * + * @author Toni Kalajainen + */ +public interface IFileList extends List { + + /** + * Get the mapped file + * + * @return file + */ + File getFile(); + + /** + * Get class-data type binding + * + * @return the binding + */ + Binding getBinding(); + + /** + * Removes from this list all of the elements whose index is between + * fromIndex, inclusive, and toIndex, exclusive. + * Shifts any succeeding elements to the left (reduces their index). This + * call shortens the List by (toIndex - fromIndex) elements. + * (If toIndex==fromIndex, this operation has no effect.)

+ * + * @param fromIndex the index of the first element to removed. + * @param toIndex index after last element to be removed (exculsive). + * + * @throws UnsupportedOperationException if the remove method is + * not supported by this list. + * @throws IndexOutOfBoundsException if the index is out of range (index + * < 0 || index + count >= size()). + */ + void removeRange(int fromIndex, int toIndex); + + /** + * Close the file + */ + void close() + throws IOException; + +} +