Code example for LinkedList

Methods: addremoveLastsize

0
	private int maxPrevValues = 10; 
	private LinkedList<TSRelational> previous = new LinkedList<TSRelational>(); 
	private long rowNum = 0; 
 
	public void addPrevious(TSRelational lastValue) { 
		previous.add(0, lastValue); 
		if (previous.size() > maxPrevValues) 
			previous.removeLast(); 
	} 
	 
	public TSRelational previousRow(int index) { 
		return previous.get(index); 
	} 
	 
	public Object previousValue(int index, String columnName) { 
		if ((previous.size()-1)<index) 
			return null; 
		return previous.get(index).get(columnName); 
	} 
 
Contextual code suggestions in your IDE  Get Codota for Java