All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ioc.commons.model.dataprovider.PagedDataProvider Maven / Gradle / Ivy

Go to download

This project defines a set of useful java interfaces for helping you in the definition of the structure of your developments in Java-projects which are designed using a Inversion-Of-Control (IOC) pattern. Useful for MVP-Pattern designs in applications coded on GWT, SWT, Android, etc.

There is a newer version: 1.2.1
Show newest version
package org.ioc.commons.model.dataprovider;

import java.util.Collection;

import org.ioc.commons.flowcontrol.common.Callback;
import org.ioc.commons.flowcontrol.operationmanager.IsOperation;
import org.ioc.commons.flowcontrol.operationmanager.OperationManagerTrigger;

public interface PagedDataProvider {
	/**
	 * Index from the first element shown within the current visible range
	 * 
	 * For instance, having 8 elements when the component is showing from 4 to
	 * 6, the returned index will be 4.
	 * 
	 * @return Min index.
	 */
	long getMinIndexVisibleRange();

	/**
	 * Min number of elements on a fetching.
	 * 
	 * The fetch method will contain a higher or equal value to this, but never
	 * lower.
	 * 
	 * @return Min number of elements requested on a fetching.
	 */
	int getMinFecthLength();

	/**
	 * Total number of elements
	 * 
	 * It needs to be a real and exact value since is used for computing the
	 * fetchings.
	 * 
	 * @return Total number of elements
	 */
	long getTotalCount();

	/**
	 * Fetch a page of data
	 * 
	 * @param callback
	 *            Callback when data has been received or a failure has ocurred.
	 * @param start
	 *            It indicates the element by which starts to fetch.
	 * @param length
	 *            The length of the fetching
	 * @param operation
	 *            Operation to be fired during the fetching.
	 * @param trigger
	 *            Trigger to fire the operation.
	 */
	 & IsOperation> void fetchData(
			Callback, Throwable> callback, long start, long length, O operation, OperationManagerTrigger trigger, String... requiredProperties);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy