    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         *
    030         * @return true if file is readable
    031         */
    032        public boolean isFileReadable();
    033
    034        /**
    035         * @param mon
    036         * @param slice
    037         * @return a slice of a dataset
    038         * @throws IOException
    039         */
    040        public IDataset getDataset(IMonitor mon, SliceND slice) throws IOException;
    041}