Code example for LinkedList

Methods: addLastcontains

0
segments.addFirst(segment);
	} 
 
	public void addChild(Object segment) throws IllegalArgumentException {
		if (segments.contains(segment)) {
			throw createCyclicPathException(segment);
		} 
		segments.addLast(segment);
	} 
 
	public TreePath getPath() { 
		return new TreePath(segments.toArray());
	} 
 
	public TreePath getParentPath() { 
		LinkedList parentSegments = new LinkedList<Object>(segments);
		parentSegments.removeLast();
		return new TreePath(parentSegments.toArray());
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE