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

org.pure4j.collections.TransientTreeSet Maven / Gradle / Ivy

There is a newer version: 0.3.1
Show newest version
package org.pure4j.collections;

import java.util.Comparator;
import java.util.TreeSet;

public class TransientTreeSet extends TreeSet implements ITransientSet {
	
	public TransientTreeSet() {
		super();
	}

	public TransientTreeSet(Comparator comparator) {
		super(comparator);
	}
	
	public TransientTreeSet(Comparator comparator, ISeq items) {
		super(comparator);
		for (T t : items) {
			add(t);
		}
	}

	@Override
	public IPersistentSet persistent() {
		IPersistentSet out =  (IPersistentSet) PersistentTreeSet.create(comparator());
		for (T t : this) {
			out = out.cons(t);
		}
		
		return out;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy