package dk.aau.cs.qweb.airbase.types;

import java.util.ArrayList;
import java.util.List;

public class Tuple {

	private List<String> data = new ArrayList<String>();
	private List<String> header = new ArrayList<String>();

	public Tuple(List<String> data, List<String> header) {
		this.data = data;
		this.header = header;
	}
	
	public List<String> getData() {
		return data;
	}
	
	public List<String> getHeader() {
		return header;
	}
	
	public String getValue(String header) {
		int index = 0;
		String result = "";
		for (String string : this.header) {
			if (header.equals(string)) {
				result = data.get(index);
			}
			index++;
		}
		return result;
	}
	
	@Override
	public String toString() {
		String string = "";
		int index = 0;
		for (String column : header) {
			string += column+": ";
			string += data.get(index)+", ";
			index++;
		}
		
		return string;
	}

}

@@ -847,11 +847,8 @@
 %09%09%7D%0A
-%09%09%0A
 %09%09re
@@ -863,11 +863,10 @@
 ing;%0A%09%7D%0A
-%0A
 %7D%0A

clean up