001/*-
002 *******************************************************************************
003 * Copyright (c) 2011, 2016 Diamond Light Source Ltd.
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *    Peter Chang - initial API and implementation and/or initial documentation
011 *******************************************************************************/
012
013package org.eclipse.january.io;
014
015import java.io.IOException;
016import java.io.Serializable;
017
018import org.eclipse.january.IMonitor;
019import org.eclipse.january.dataset.IDataset;
020import org.eclipse.january.dataset.SliceND;
021
022/**
023 * Used by lazy datasets to read slices from a file
024 */
025public interface ILazyLoader extends Serializable {
026        public static final long serialVersionUID = -611684979804645511L;
027
028        /**
029         * @return true if file is readable
030         */
031        public boolean isFileReadable();
032
033        /**
034         * @param mon can be null
035         * @param slice source where items of data fetched
036         * @return a slice of a dataset
037         * @throws IOException when cannot retrieve data
038         */
039        public IDataset getDataset(IMonitor mon, SliceND slice) throws IOException;
040}