Code example for LinkedList

Methods: addLast

0
public class GDFocusTraversalPolicy extends FocusTraversalPolicy { 
 
	private final LinkedList<Component> list = new LinkedList<Component>(); 
 
	public void addComponent(final Component comp) { 
		this.list.addLast(comp); 
	} 
 
	@Override 
	public Component getComponentAfter(final Container arg0, final Component comp) { 
		int index = this.list.indexOf(comp) + 1; 
		if (index == this.list.size()) { 
			index = 0; 
		} 
		return this.list.get(index); 
	} 
 
	@Override 
	public Component getComponentBefore(final Container arg0, final Component comp) { 
		int index = this.list.indexOf(comp) - 1; 
		if (index == -1) {