Code example for LinkedList

Methods: removeLast, toArray

0
	public TreePath getPath() { 
		return new TreePath(segments.toArray());
	} 
 
	public TreePath getParentPath() { 
		LinkedList parentSegments = new LinkedList<Object>(segments);
		parentSegments.removeLast();
		return new TreePath(parentSegments.toArray());
	} 
 
	public Object getLastSegment() {
		return segments.getLast();
	} 
 
	public Object getFirstSegment() {
		return segments.getFirst();
	} 
 
	@Override 
	public String toString() {
		StringBuffer buffer = new StringBuffer();