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

com.g2forge.alexandria.adt.collection.strategy.ACollectionStrategy Maven / Gradle / Ivy

There is a newer version: 0.0.18
Show newest version
package com.g2forge.alexandria.adt.collection.strategy;

import java.util.Collection;

import com.g2forge.alexandria.adt.collection.collector.ICollectionBuilder;
import com.g2forge.alexandria.adt.collection.collector.implementations.CollectionCollectionBuilder;

public abstract class ACollectionStrategy, T> implements ICollectionStrategy {
	protected class Builder extends CollectionCollectionBuilder {
		public Builder() {
			super(ACollectionStrategy.this.create(null));
		}

		@Override
		public C get() {
			return ACollectionStrategy.this.create(collection);
		}
	}

	@Override
	public ICollectionBuilder builder() {
		return new Builder();
	}

	protected abstract C create(C copy);

	@Override
	public Iterable iterable(C collection) {
		return collection;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy