org.pure4j.collections.TransientTreeMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pure4j-core Show documentation
Show all versions of pure4j-core Show documentation
Pure Functional Programming Semantics For Java
package org.pure4j.collections;
import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;
public class TransientTreeMap extends TreeMap implements ITransientMap {
public TransientTreeMap() {
super();
}
public TransientTreeMap(Comparator super K> comparator) {
super(comparator);
}
public TransientTreeMap(PersistentTreeMap pt) {
this(pt.comparator());
for (Map.Entry entry : pt.entrySet()) {
this.put(entry.getKey(), entry.getValue());
}
}
@Override
public int count() {
return size();
}
@Override
public IPersistentMap persistent() {
return PersistentTreeMap.create(comparator(), this);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy