
org.aksw.jena_sparql_api.views.NestedStack Maven / Gradle / Ivy
package org.aksw.jena_sparql_api.views;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class NestedStack
{
private NestedStack parent;
private T value;
public NestedStack(NestedStack parent, T value) {
super();
this.parent = parent;
this.value = value;
}
public NestedStack getParent() {
return parent;
}
public T getValue() {
return value;
}
public List asList() {
List result = new ArrayList();
NestedStack current = this;
while(current != null) {
result.add(current.getValue());
current = current.parent;
}
Collections.reverse(result);
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy