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

org.etlunit.BaseFeatureLocator Maven / Gradle / Ivy

There is a newer version: 1.6.9
Show newest version
package org.etlunit;

import org.etlunit.feature.Feature;
import org.etlunit.feature.FeatureLocator;
import org.etlunit.feature.FeatureMetaInfo;

import java.util.Iterator;
import java.util.List;

public abstract class BaseFeatureLocator implements FeatureLocator
{
	@Override
	public List getFeatures(feature_type type)
	{
		List list = getFeatures();

		if (type != feature_type.all)
		{
			Iterator it = list.iterator();

			while (it.hasNext())
			{
				Feature feature = it.next();

				FeatureMetaInfo metaInfo = feature.getMetaInfo();

				switch (type)
				{
					case internal:
						if (!metaInfo.isInternalFeature())
						{
							it.remove();
						}
						break;
					case external:
						if (metaInfo.isInternalFeature())
						{
							it.remove();
						}
						break;
				}
			}
		}

		return list;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy