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

org.aksw.jena_sparql_api.views.NestedStack Maven / Gradle / Ivy

There is a newer version: 3.17.0-1
Show newest version
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