1 /*******************************************************************************
2 * Copyright (c) 2000, 2011 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Jesper Kamstrup Linnet (eclipse@kamstrup-linnet.dk) - initial API and implementation
10 * (report 36180: Callers/Callees view)
11 *******************************************************************************/
12 package org.eclipse.jdt.internal.ui.callhierarchy;
14 import java.util.ArrayList;
15 import java.util.Arrays;
16 import java.util.List;
18 import org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper;
20 public class TreeRoot {
21 public static final Object EMPTY_ROOT = new Object();
22 private MethodWrapper[] fRoots;
24 public TreeRoot(MethodWrapper[] roots) {
28 MethodWrapper[] getRoots() {
33 * Adds the new roots to the list.
35 * @param roots the roots to add
38 void addRoots(MethodWrapper[] roots){
39 List<MethodWrapper>newRoots= new ArrayList<MethodWrapper>();
40 newRoots.addAll(Arrays.asList(fRoots));
41 newRoots.addAll(Arrays.asList(roots));
43 fRoots= newRoots.toArray(new MethodWrapper[newRoots.size()]);