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

org.robobinding.property.ArrayDataSet Maven / Gradle / Ivy

The newest version!
package org.robobinding.property;

import org.robobinding.itempresentationmodel.DataSetChangeListener;
import org.robobinding.itempresentationmodel.RefreshableItemPresentationModelFactory;


/**
 * @since 1.0
 * @author Cheng Wei
 *
 */
public class ArrayDataSet extends AbstractDataSet {
	public ArrayDataSet(RefreshableItemPresentationModelFactory factory, AbstractGetSet getSet) {
		super(factory, getSet);
	}

	@Override
	public int size() {
		if (isDataSetNull())
			return 0;

		Object[] array = getDataSet();
		return array.length;
	}

	@Override
	public Object get(int position) {
		Object[] array = getDataSet();
		return array[position];
	}
	
	@Override
	public void addListener(DataSetChangeListener listener) {
		//not supported.
	}

	@Override
	public void removeListener(DataSetChangeListener listener) {
		//not supported.
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy