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

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

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

import java.util.Collection;
import java.util.HashSet;

import org.pure4j.Pure4J;
import org.pure4j.annotations.pure.Enforcement;
import org.pure4j.annotations.pure.Pure;
import org.pure4j.annotations.pure.PureParameters;

public class TransientHashSet extends HashSet implements ITransientSet {

	public TransientHashSet() {
		super();
	}

	@PureParameters(Enforcement.NOT_PURE)
	public TransientHashSet(Collection c) {
		super(c);
	}

	public TransientHashSet(int initialCapacity, float loadFactor) {
		super(initialCapacity, loadFactor);
	}

	public TransientHashSet(int initialCapacity) {
		super(initialCapacity);
	}

	@Override
	public IPersistentSet persistent() {
		return new PersistentHashSet(this);
	}

	@Override
	public boolean contains(Object o) {
		Pure4J.immutable(o);
		return super.contains(o);
	}

	@Override
	public boolean add(T e) {
		Pure4J.immutable(e);
		return super.add(e);
	}

	@Override
	public boolean remove(Object o) {
		Pure4J.immutable(o);
		return super.remove(o);
	}

	@Override
	public boolean removeAll(Collection c) {
		Pure4J.immutable(c);
		return super.removeAll(c);
	}

	@Pure(value=Enforcement.FORCE)
	@Override
	public  T[] toArray(T[] a) {
		return super.toArray(a);
	}

	@Override
	public boolean containsAll(Collection c) {
		Pure4J.immutable(c);
		return super.containsAll(c);
	}

	@Override
	public boolean addAll(Collection c) {
		Pure4J.immutable(c);
		return super.addAll(c);
	}

	@Override
	public boolean retainAll(Collection c) {
		Pure4J.immutable(c);
		return super.retainAll(c);
	}
	
	

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy