
impl.nodepaths.ImmutableNodePath Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of flexible-tree Show documentation
Show all versions of flexible-tree Show documentation
Library for generating permutation of given value domains
The newest version!
package impl.nodepaths;
import api.utils.NodePath;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedDeque;
/**
* This is a node path which values can not be changed
*/
public class ImmutableNodePath implements NodePath{
private final ConcurrentLinkedDeque values = new ConcurrentLinkedDeque<>();
public ImmutableNodePath() {}
public ImmutableNodePath(T value){
assert value != null;
this.values.add(value);
}
public ImmutableNodePath(List values) {
assert values != null;
this.values.addAll(values);
}
public ImmutableNodePath(List values, T value) {
assert values != null;
assert value != null;
this.values.addAll(values);
this.values.add(value);
}
@Override
public List getNodes() {
return new ArrayList<>(values);
}
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
@Override
public boolean equals(Object o) {
return isEqual(o);
}
@Override
public int hashCode() {
return getHashCode();
}
@Override
public String toString() {
return getAsString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy