]> git.uio.no Git - ifi-stolz-refaktor.git/blob - case-study/jdt-before/ui/org/eclipse/jdt/internal/ui/callhierarchy/TreeRoot.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / ui / org / eclipse / jdt / internal / ui / callhierarchy / TreeRoot.java
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
7  *
8  * Contributors:
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;
13
14 import java.util.ArrayList;
15 import java.util.Arrays;
16 import java.util.List;
17
18 import org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper;
19
20 public class TreeRoot {
21     public static final Object EMPTY_ROOT = new Object();
22     private MethodWrapper[] fRoots;
23
24     public TreeRoot(MethodWrapper[] roots) {
25         this.fRoots = roots;
26     }
27
28     MethodWrapper[] getRoots() {
29         return fRoots;
30     }
31     
32         /**
33          * Adds the new roots to the list.
34          * 
35          * @param roots the roots to add
36          * @since 3.7
37          */
38     void addRoots(MethodWrapper[] roots){
39                 List<MethodWrapper>newRoots= new ArrayList<MethodWrapper>();
40                 newRoots.addAll(Arrays.asList(fRoots));
41                 newRoots.addAll(Arrays.asList(roots));
42
43                 fRoots= newRoots.toArray(new MethodWrapper[newRoots.size()]);
44     }
45
46
47 }