class ClassifyQuery extends BaseQueryFunction<MapState<Classifier<L>>, L> {

	@SuppressWarnings("unchecked")
	@Override
	public List<L> batchRetrieve(MapState<Classifier<L>> state, List<TridentTuple> tuples) {
		List<L> labels = new ArrayList<L>();

		List<Classifier<L>> classifiers = state.multiGet(KeysUtil.toKeys(this.classifierName));
		if (classifiers != null && !classifiers.isEmpty()) {
			Classifier<L> classifier = classifiers.get(0);
			if (classifier == null) {
				for (int i = 0; i < tuples.size(); i++) {
					labels.add(null);
				}
			} else {

				L label;
				Instance<L> instance;
				for (TridentTuple tuple : tuples) {
					instance = (Instance<L>) tuple.get(0);
					label = classifier.classify(instance.features);
					labels.add(label);
				}
			}
		} else {
			for (int i = 0; i < tuples.size(); i++) {
				labels.add(null);
			}
		}

		return labels;
	}

	public  ClassifyQuery(String classifierName);

}